/
rake_task.feature
68 lines (56 loc) · 1.56 KB
/
rake_task.feature
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
Feature: rake task
RSpec ships with a rake task with a number of useful options
Scenario: default options with passing spec (prints command and exit status is 0)
Given a file named "Rakefile" with:
"""
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
"""
And a file named "spec/thing_spec.rb" with:
"""
describe "something" do
it "does something" do
# pass
end
end
"""
When I run `rake`
Then the stderr should contain "ruby -S rspec"
Then the exit status should be 0
Scenario: default options with failing spec (exit status is 1)
Given a file named "Rakefile" with:
"""
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
"""
And a file named "spec/thing_spec.rb" with:
"""
describe "something" do
it "does something" do
fail
end
end
"""
When I run `rake`
Then the exit status should be 1
Scenario: fail_on_error = false with failing spec (exit status is 0)
Given a file named "Rakefile" with:
"""
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.fail_on_error = false
end
task :default => :spec
"""
And a file named "spec/thing_spec.rb" with:
"""
describe "something" do
it "does something" do
fail
end
end
"""
When I run `rake`
Then the exit status should be 0