/
show_failures_in_pending_blocks.feature
61 lines (54 loc) · 1.92 KB
/
show_failures_in_pending_blocks.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
Feature: show_failures_in_pending_blocks
Use the show_failures_in_pending_blocks option to run the code in pending blocks while keeping the tests pending.
RSpec.configure { |c| c.show_failures_in_pending_blocks = true }
Background:
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure {|c| c.show_failures_in_pending_blocks = true}
"""
Scenario: by default, code in pending examples is not exercised
Given a file named "spec/example_spec.rb" with:
"""ruby
describe "fails" do
pending "code will not be exercised" do
fail
end
end
"""
When I run `rspec spec/example_spec.rb`
Then the output should not contain "Failure/Error: pending { fail }"
Scenario: by default, code in pending blocks inside examples is not exercised
Given a file named "spec/example_spec.rb" with:
"""ruby
describe "fails" do
it "code will not be exercised" do
pending { fail }
end
end
"""
When I run `rspec spec/example_spec.rb`
Then the output should not contain "Failure/Error: pending { fail }"
Scenario: when turned on, pending code blocks inside examples are exercised
Given a file named "spec/example_spec.rb" with:
"""ruby
require "spec_helper"
describe "fails" do
it "code will be exercised" do
pending { fail }
end
end
"""
When I run `rspec spec/example_spec.rb`
Then the output should contain "Failure/Error: pending { fail }"
Scenario: when turned on, code inside pending examples is not exercised
Given a file named "spec/example_spec.rb" with:
"""ruby
require "spec_helper"
describe "fails" do
pending "code will not be exercised" do
fail
end
end
"""
When I run `rspec spec/example_spec.rb`
Then the output should not contain "Failure/Error: pending { fail }"