-
Notifications
You must be signed in to change notification settings - Fork 28
/
Rakefile
61 lines (48 loc) · 1.75 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'rubygems'
require 'bundler'
require 'rspec/core/rake_task'
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
Bundler::GemHelper.install_tasks
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.ruby_opts = "-I lib:spec"
spec.pattern = 'spec/**/*_spec.rb'
spec.rspec_opts = "--color"
end
task :spec
task :lib do
$LOAD_PATH.unshift(File.expand_path("lib", File.dirname(__FILE__)))
end
task :reload_gem do
gem_name = "cuke_sniffer"
version = "1.1.0"
system "gem uninstall #{gem_name}"
system "gem build #{gem_name}.gemspec"
system "gem install #{gem_name}-#{version}.gem"
end
task :travis do
["rspec spec", "rake jasmine:ci"].each do |cmd|
puts "Starting to run #{cmd}..."
system("export DISPLAY=:99.0 && bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
end
task :default => :spec
task :rebuild_complex_examples do
rebuildExamples "examples/complex_project/"
end
task :rebuild_simple_examples do
rebuildExamples "examples/simple_project/"
end
task :rebuild_empty_examples do
rebuildExamples "examples/empty_project/"
end
task :rebuild_all_examples => [:rebuild_complex_examples, :rebuild_simple_examples, :rebuild_empty_examples]
def rebuildExamples(folder_name)
target_folder = folder_name + "features"
system "cuke_sniffer -p " + target_folder + " > " + folder_name + "console_output.txt"
system "cuke_sniffer -o html " + folder_name + "/cuke_sniffer_results.html -p " + target_folder
system "cuke_sniffer -o min_html " + folder_name + "/min_cuke_sniffer_results.html -p " + target_folder
system "cuke_sniffer -o xml " + folder_name + "/cuke_sniffer_results.xml -p " + target_folder
system "cuke_sniffer -o junit_xml " + folder_name + "/junit_cuke_sniffer_results.xml -p " + target_folder
end