-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
69 lines (59 loc) · 1.98 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
62
63
64
65
66
67
68
69
require 'rubygems'
require 'rake'
require 'cucumber'
require 'cucumber/rake/task'
require 'ceedling'
PROJECT_CEEDLING_ROOT = "vendor/ceedling"
load "#{PROJECT_CEEDLING_ROOT}/lib/rakefile.rb"
task :default => %w[ test:all features:finished ]
class BuildFailure < Exception
def initialize(message = nil)
message ||= "Build failed"
super(message)
end
end
# Cucumber::Rake::Task.new do |t|
# t.cucumber_opts = "--format progress"
# end
namespace :features do
desc "Run finished features"
Cucumber::Rake::Task.new(:finished) do |t|
t.cucumber_opts = "--format progress test/features"
t.libs = $LOAD_PATH
# t.pattern = 'test/features/*.features'
end
# desc "Run in-progress features"
# Cucumber::Rake::Task.new(:in_progress) do |t|
# t.cucumber_opts = "--require formatters/ --format Cucumber::Formatter::InProgress --tags in-progress"
# t.pattern = 'test/features/*.features'
# end
# desc "Re-run failed features"
# Cucumber::Rake::Task.new(:failed) do |t|
# unless File.exist?(File.join(Rails.root, 'build/tmp/rerun.txt'))
# File.open(File.join(Rails.root, 'build/tmp/rerun.txt'), 'w+').close
# t.profile = 'rerun'
# t.cucumber_opts = "--format rerun --out build/tmp/rerun.txt"
# t.pattern = 'test/features/*.features'
# end
end
# desc "Run complete feature build"
# task :cruise do
# finished_successful = run_and_check_for_exception("finished")
# in_progress_successful = run_and_check_for_exception("in_progress")
# unless finished_successful && in_progress_successful
# puts
# puts("Finished features had failing steps") unless finished_successful
# puts("In-progress Scenario/s passed when they should fail or be pending") unless in_progress_successful
# puts
# raise BuildFailure
# end
# end
# def run_and_check_for_exception(task_name)
# puts "*** Running #{task_name} features ***"
# begin
# Rake::Task["features:#{task_name}"].invoke
# rescue Exception => e
# return false
# end
# true
# end