rspec-given 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -12
- data/README.md +18 -9
- data/examples/failing/natural_failing_spec.rb +3 -3
- data/examples/integration/and_spec.rb +1 -1
- data/spec/lib/given/binary_operation_spec.rb +9 -9
- data/spec/lib/given/evaluator_spec.rb +10 -10
- data/spec/lib/given/extensions_spec.rb +49 -49
- data/spec/lib/given/failure_spec.rb +5 -5
- data/spec/lib/given/file_cache_spec.rb +5 -5
- data/spec/lib/given/have_failed_spec.rb +47 -47
- data/spec/lib/given/line_extractor_spec.rb +7 -7
- data/spec/lib/given/module_methods_spec.rb +2 -2
- data/spec/lib/given/natural_assertion_spec.rb +50 -50
- data/spec/lib/given/options_spec.rb +23 -23
- data/spec/spec_helper.rb +5 -5
- data/spec/support/be_booleany.rb +15 -0
- metadata +6 -8
- data/README.old +0 -902
- data/test/before_test.rb +0 -22
- data/test/meme_test.rb +0 -36
@@ -10,15 +10,15 @@ module Given
|
|
10
10
|
When(:result) { cache.get(file_name) }
|
11
11
|
|
12
12
|
context "when reading the file" do
|
13
|
-
Then { result[DESCRIBE_LINE].
|
14
|
-
Then { result.size.
|
13
|
+
Then { expect(result[DESCRIBE_LINE]).to match(/describe FileCache do/) }
|
14
|
+
Then { expect(result.size).to eq MAX_LINE }
|
15
15
|
end
|
16
16
|
|
17
17
|
context "when getting the same file twice" do
|
18
|
-
Given { cache.
|
18
|
+
Given { expect(cache).to receive(:read_lines).once.and_return(["A"]) }
|
19
19
|
When(:result2) { cache.get(file_name) }
|
20
|
-
Then { result.
|
21
|
-
Then { result2.
|
20
|
+
Then { expect(result).to eq ["A"] }
|
21
|
+
Then { expect(result2).to eq ["A"] }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -6,65 +6,65 @@ module HaveFailedSpec
|
|
6
6
|
ExpectationError = RSpec::Expectations::ExpectationNotMetError
|
7
7
|
|
8
8
|
describe "#have_failed" do
|
9
|
-
|
10
|
-
|
9
|
+
context "with a failure" do
|
10
|
+
When(:result) { fail CustomError, "Ouch" }
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
Then { expect(result).to raise_error(CustomError, "Ouch") }
|
13
|
+
Then { expect(result).to have_failed(CustomError, "Ouch") }
|
14
|
+
Then { expect(result).to have_raised(CustomError, "Ouch") }
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
Then { expect { expect(result).to be_nil }.to raise_error(CustomError, "Ouch") }
|
17
|
+
Then { expect { expect(result).to eq(0) }.to raise_error(CustomError, "Ouch") }
|
18
|
+
Then { expect { expect(result).to_not eq(0) }.to raise_error(CustomError, "Ouch") }
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
Then { expect { expect(result).to_not have_failed }.to raise_error(ExpectationError) }
|
21
|
+
end
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
context "with a standard failure" do
|
24
|
+
When(:result) { fail "Ouch" }
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
Then { expect(result).to raise_error(StandardError, "Ouch") }
|
27
|
+
Then { expect(result).to raise_error(StandardError, /^O/) }
|
28
|
+
Then { expect(result).to raise_error(StandardError) }
|
29
|
+
Then { expect(result).to raise_error }
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
Then { expect(result).to have_failed(StandardError, "Ouch") }
|
32
|
+
Then { expect(result).to have_failed(StandardError, /^O/) }
|
33
|
+
Then { expect(result).to have_failed(StandardError) }
|
34
|
+
Then { expect(result).to have_failed }
|
35
|
+
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
context "with a different failure" do
|
38
|
+
When(:result) { fail CustomError, "Ouch" }
|
39
|
+
Then { expect { expect(result).to have_failed(DifferentError) }.to raise_error(ExpectationError) }
|
40
|
+
end
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
context "with a pending exception" do
|
43
|
+
When(:result) { fail RSpec::Core::Pending::PendingDeclaredInExample, "Required pending in example ... please ignore" }
|
44
|
+
Then { Given.fail_with "This example should have been pending" }
|
45
|
+
end
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
context "with a non-failure" do
|
48
|
+
When(:result) { :ok }
|
49
|
+
Then { expect(result).to_not have_failed }
|
50
|
+
Then { expect { expect(result).to have_failed }.to raise_error(RSpec::Expectations::ExpectationNotMetError) }
|
51
|
+
end
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
context "with natural assertions" do
|
54
|
+
use_natural_assertions_if_supported
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
context "with failure" do
|
57
|
+
When(:result) { fail CustomError, "Ouch" }
|
58
|
+
Then { result == have_failed(CustomError, "Ouch") }
|
59
|
+
Then { ! (result != have_failed) }
|
60
|
+
Then { expect { result == :something }.to raise_error(CustomError, "Ouch") }
|
61
|
+
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
context "with different failure" do
|
64
|
+
When(:result) { fail DifferentError, "Ouch" }
|
65
|
+
Then { ! (result == have_failed(CustomError, "Ouch")) }
|
66
|
+
end
|
67
67
|
|
68
|
+
end
|
68
69
|
end
|
69
70
|
end
|
70
|
-
end
|
@@ -27,12 +27,12 @@ module Given
|
|
27
27
|
" of their fellowmen\n"
|
28
28
|
}
|
29
29
|
Given(:expected_line) { " for all good men\n" }
|
30
|
-
Then { result.
|
30
|
+
Then { expect(result).to eq(expected_line) }
|
31
31
|
end
|
32
32
|
|
33
33
|
context "when the line doesn't exist" do
|
34
34
|
Given(:input) { "" }
|
35
|
-
Then { result.
|
35
|
+
Then { expect(result).to be_nil }
|
36
36
|
end
|
37
37
|
|
38
38
|
context "when the line has leading and trailing white space" do
|
@@ -40,7 +40,7 @@ module Given
|
|
40
40
|
" Then { y } \n" +
|
41
41
|
" Then { x }\n"
|
42
42
|
}
|
43
|
-
Then { result.
|
43
|
+
Then { expect(result).to eq(" Then { x }\n") }
|
44
44
|
end
|
45
45
|
|
46
46
|
context "when the Then is split over several lines with {}" do
|
@@ -51,7 +51,7 @@ module Given
|
|
51
51
|
" }\n" +
|
52
52
|
"end\n"
|
53
53
|
}
|
54
|
-
Then { result.
|
54
|
+
Then { expect(result).to eq(" Then {\n x\n }\n") }
|
55
55
|
end
|
56
56
|
|
57
57
|
context "when the Then is has blank lines" do
|
@@ -62,7 +62,7 @@ module Given
|
|
62
62
|
" }\n" +
|
63
63
|
"end\n"
|
64
64
|
}
|
65
|
-
Then { result.
|
65
|
+
Then { expect(result).to eq(" Then {\n\n x\n }\n") }
|
66
66
|
end
|
67
67
|
|
68
68
|
context "when the Then is split over several lines with do/end" do
|
@@ -73,12 +73,12 @@ module Given
|
|
73
73
|
" end\n" +
|
74
74
|
"end\n"
|
75
75
|
}
|
76
|
-
Then { result.
|
76
|
+
Then { expect(result).to eq(" Then do\n x\n end\n") }
|
77
77
|
end
|
78
78
|
|
79
79
|
describe "converting to a string" do
|
80
80
|
Given(:input) { "" }
|
81
|
-
Then { extractor.to_s.
|
81
|
+
Then { expect(extractor.to_s).to match(/line *extractor/i) }
|
82
82
|
end
|
83
83
|
end
|
84
84
|
end
|
@@ -5,9 +5,9 @@ describe "RSpec::Given.use_natural_assertions" do
|
|
5
5
|
When(:result) { ::Given.use_natural_assertions }
|
6
6
|
|
7
7
|
if ::Given::NATURAL_ASSERTIONS_SUPPORTED
|
8
|
-
Then { result.
|
8
|
+
Then { expect(result).to_not have_failed }
|
9
9
|
else
|
10
|
-
Then { result.
|
10
|
+
Then { expect(result).to have_failed(ArgumentError) }
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -9,107 +9,107 @@ describe Given::NaturalAssertion do
|
|
9
9
|
describe "#content?" do
|
10
10
|
context "with empty block" do
|
11
11
|
FauxThen { }
|
12
|
-
Then { na.
|
12
|
+
Then { expect(na).to_not have_content }
|
13
13
|
end
|
14
14
|
context "with block returning false" do
|
15
15
|
FauxThen { false }
|
16
|
-
Then { na.
|
16
|
+
Then { expect(na).to have_content }
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "failure messages" do
|
21
21
|
let(:msg) { na.message }
|
22
|
-
Invariant { msg.
|
22
|
+
Invariant { expect(msg).to match(/^FauxThen expression/) }
|
23
23
|
|
24
24
|
context "with equals assertion" do
|
25
25
|
Given(:a) { 1 }
|
26
26
|
FauxThen { a == 2 }
|
27
|
-
Then { msg.
|
28
|
-
Then { msg.
|
29
|
-
Then { msg.
|
30
|
-
Then { msg.
|
27
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
28
|
+
Then { expect(msg).to match(/\bto equal: +2\b/) }
|
29
|
+
Then { expect(msg).to match(/\bfalse +<- +a == 2\b/) }
|
30
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
31
31
|
end
|
32
32
|
|
33
33
|
context "with equals assertion with do/end" do
|
34
34
|
Given(:a) { 1 }
|
35
35
|
FauxThen do a == 2 end
|
36
|
-
Then { msg.
|
37
|
-
Then { msg.
|
38
|
-
Then { msg.
|
39
|
-
Then { msg.
|
36
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
37
|
+
Then { expect(msg).to match(/\bto equal: +2\b/) }
|
38
|
+
Then { expect(msg).to match(/\bfalse +<- +a == 2\b/) }
|
39
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
40
40
|
end
|
41
41
|
|
42
42
|
context "with not-equals assertion" do
|
43
43
|
Given(:a) { 1 }
|
44
44
|
FauxThen { a != 1 }
|
45
|
-
Then { msg.
|
46
|
-
Then { msg.
|
47
|
-
Then { msg.
|
48
|
-
Then { msg.
|
45
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
46
|
+
Then { expect(msg).to match(/\bto not equal: +1\b/) }
|
47
|
+
Then { expect(msg).to match(/\bfalse +<- +a != 1\b/) }
|
48
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
49
49
|
end
|
50
50
|
|
51
51
|
context "with less than assertion" do
|
52
52
|
Given(:a) { 1 }
|
53
53
|
FauxThen { a < 1 }
|
54
|
-
Then { msg.
|
55
|
-
Then { msg.
|
56
|
-
Then { msg.
|
57
|
-
Then { msg.
|
54
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
55
|
+
Then { expect(msg).to match(/\bto be less than: +1\b/) }
|
56
|
+
Then { expect(msg).to match(/\bfalse +<- +a < 1\b/) }
|
57
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
58
58
|
end
|
59
59
|
|
60
60
|
context "with less than or equal to assertion" do
|
61
61
|
Given(:a) { 1 }
|
62
62
|
FauxThen { a <= 0 }
|
63
|
-
Then { msg.
|
64
|
-
Then { msg.
|
65
|
-
Then { msg.
|
66
|
-
Then { msg.
|
63
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
64
|
+
Then { expect(msg).to match(/\bto be less or equal to: +0\b/) }
|
65
|
+
Then { expect(msg).to match(/\bfalse +<- +a <= 0\b/) }
|
66
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
67
67
|
end
|
68
68
|
|
69
69
|
context "with greater than assertion" do
|
70
70
|
Given(:a) { 1 }
|
71
71
|
FauxThen { a > 1 }
|
72
|
-
Then { msg.
|
73
|
-
Then { msg.
|
74
|
-
Then { msg.
|
75
|
-
Then { msg.
|
72
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
73
|
+
Then { expect(msg).to match(/\bto be greater than: +1\b/) }
|
74
|
+
Then { expect(msg).to match(/\bfalse +<- +a > 1\b/) }
|
75
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
76
76
|
end
|
77
77
|
|
78
78
|
context "with greater than or equal to assertion" do
|
79
79
|
Given(:a) { 1 }
|
80
80
|
FauxThen { a >= 3 }
|
81
|
-
Then { msg.
|
82
|
-
Then { msg.
|
83
|
-
Then { msg.
|
84
|
-
Then { msg.
|
81
|
+
Then { expect(msg).to match(/\bexpected: +1\b/) }
|
82
|
+
Then { expect(msg).to match(/\bto be greater or equal to: +3\b/) }
|
83
|
+
Then { expect(msg).to match(/\bfalse +<- +a >= 3\b/) }
|
84
|
+
Then { expect(msg).to match(/\b1 +<- +a\b/) }
|
85
85
|
end
|
86
86
|
|
87
87
|
context "with match assertion" do
|
88
88
|
Given(:s) { "Hello" }
|
89
89
|
FauxThen { s =~ /HI/ }
|
90
|
-
Then { msg.
|
91
|
-
Then { msg.
|
92
|
-
Then { msg.
|
93
|
-
Then { msg.
|
90
|
+
Then { expect(msg).to match(/\bexpected: +"Hello"$/) }
|
91
|
+
Then { expect(msg).to match(/\bto match: +\/HI\/$/) }
|
92
|
+
Then { expect(msg).to match(/\bnil +<- +s =~ \/HI\/$/) }
|
93
|
+
Then { expect(msg).to match(/"Hello" +<- +s$/) }
|
94
94
|
end
|
95
95
|
|
96
96
|
context "with not match assertion" do
|
97
97
|
Given(:s) { "Hello" }
|
98
98
|
FauxThen { s !~ /Hello/ }
|
99
|
-
Then { msg.
|
100
|
-
Then { msg.
|
101
|
-
Then { msg.
|
102
|
-
Then { msg.
|
99
|
+
Then { expect(msg).to match(/\bexpected: +"Hello"$/) }
|
100
|
+
Then { expect(msg).to match(/\bto not match: +\/Hello\/$/) }
|
101
|
+
Then { expect(msg).to match(/\bfalse +<- +s !~ \/Hello\/$/) }
|
102
|
+
Then { expect(msg).to match(/"Hello" +<- +s$/) }
|
103
103
|
end
|
104
104
|
|
105
105
|
context "with exception" do
|
106
106
|
Given(:ary) { nil }
|
107
107
|
FauxThen { ary[1] == 3 }
|
108
|
-
Then { msg.
|
109
|
-
Then { msg.
|
110
|
-
Then { msg.
|
111
|
-
Then { msg.
|
112
|
-
Then { msg.
|
108
|
+
Then { expect(msg).to match(/\bexpected: +NoMethodError/) }
|
109
|
+
Then { expect(msg).to match(/\bto equal: +3$/) }
|
110
|
+
Then { expect(msg).to match(/\bNoMethodError.+NilClass\n +<- +ary\[1\] == 3$/) }
|
111
|
+
Then { expect(msg).to match(/\bNoMethodError.+NilClass\n +<- +ary\[1\]$/) }
|
112
|
+
Then { expect(msg).to match(/\bnil +<- +ary$/) }
|
113
113
|
end
|
114
114
|
|
115
115
|
context "with value with newlines" do
|
@@ -123,10 +123,10 @@ describe Given::NaturalAssertion do
|
|
123
123
|
end
|
124
124
|
Given(:zzzz) { FunkyInspect.new }
|
125
125
|
FauxThen { zzzz.ok? }
|
126
|
-
Then { msg.
|
127
|
-
Then { msg.
|
128
|
-
Then { msg.
|
129
|
-
Then { msg.
|
126
|
+
Then { expect(msg).to match(/\n false <- zzzz\.ok\?/) }
|
127
|
+
Then { expect(msg).to match(/\n XXXX\n/) }
|
128
|
+
Then { expect(msg).to match(/\n YYYY\n/) }
|
129
|
+
Then { expect(msg).to match(/\n <- zzzz$/) }
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
@@ -134,7 +134,7 @@ describe Given::NaturalAssertion do
|
|
134
134
|
context "with no statements" do
|
135
135
|
FauxThen { }
|
136
136
|
When(:result) { na.message }
|
137
|
-
Then { result.
|
137
|
+
Then { expect(result).to_not have_failed }
|
138
138
|
end
|
139
139
|
|
140
140
|
context "with multiple statements" do
|
@@ -143,7 +143,7 @@ describe Given::NaturalAssertion do
|
|
143
143
|
ary[1] == 3
|
144
144
|
}
|
145
145
|
When(:result) { na.message }
|
146
|
-
Then { result.
|
146
|
+
Then { expect(result).to have_failed(Given::InvalidThenError, /multiple.*statements/i) }
|
147
147
|
end
|
148
148
|
|
149
149
|
end
|
@@ -8,17 +8,17 @@ describe "Configuration Options" do
|
|
8
8
|
_Gvn_context_info[:name] = "Outer"
|
9
9
|
_Gvn_context_info[:outer] = true
|
10
10
|
|
11
|
-
Then { _gvn_info(:name).
|
12
|
-
Then { _gvn_info(:outer).
|
13
|
-
Then { _gvn_info(:inner).
|
11
|
+
Then { expect(_gvn_info(:name)).to eq("Outer") }
|
12
|
+
Then { expect(_gvn_info(:outer)).to eq(true) }
|
13
|
+
Then { expect(_gvn_info(:inner)).to eq(nil) }
|
14
14
|
|
15
15
|
context "Inner" do
|
16
16
|
_Gvn_context_info[:name] = "Inner"
|
17
17
|
_Gvn_context_info[:inner] = true
|
18
18
|
|
19
|
-
Then { _gvn_info(:name).
|
20
|
-
Then { _gvn_info(:outer).
|
21
|
-
Then { _gvn_info(:inner).
|
19
|
+
Then { expect(_gvn_info(:name)).to eq("Inner") }
|
20
|
+
Then { expect(_gvn_info(:outer)).to eq(true) }
|
21
|
+
Then { expect(_gvn_info(:inner)).to eq(true) }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -43,21 +43,21 @@ describe "Configuration Options" do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
context "with no explicit word on natural assertions" do
|
46
|
-
Then { _gvn_need_na_message?(nassert).
|
46
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
47
47
|
|
48
48
|
context "overridden locally" do
|
49
49
|
use_natural_assertions_if_supported
|
50
|
-
Then { _gvn_need_na_message?(nassert).
|
50
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
context "with global configuration enabled" do
|
55
55
|
When { Given.use_natural_assertions }
|
56
|
-
Then { _gvn_need_na_message?(nassert).
|
56
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
57
57
|
|
58
58
|
context "overridden locally" do
|
59
59
|
use_natural_assertions false
|
60
|
-
Then { _gvn_need_na_message?(nassert).
|
60
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
61
61
|
end
|
62
62
|
|
63
63
|
context "with rspec assertion" do
|
@@ -67,71 +67,71 @@ describe "Configuration Options" do
|
|
67
67
|
# If RSpec was successfully patched to record matchers,
|
68
68
|
# then the "need NA" logic will ignore possible matches in
|
69
69
|
# the source code.
|
70
|
-
_gvn_need_na_message?(nassert).
|
70
|
+
expect(_gvn_need_na_message?(nassert)).to be_truthy
|
71
71
|
else
|
72
72
|
# If RSpec was not successfully patched to record
|
73
73
|
# matchers, then the "need NA" logic will check for
|
74
74
|
# should/expect in the source.
|
75
|
-
_gvn_need_na_message?(nassert).
|
75
|
+
expect(_gvn_need_na_message?(nassert)).to be_falsy
|
76
76
|
end
|
77
77
|
}
|
78
78
|
end
|
79
79
|
|
80
80
|
context "without rspec assertion" do
|
81
81
|
Given(:rspec) { false }
|
82
|
-
Then { _gvn_need_na_message?(nassert).
|
82
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
83
83
|
end
|
84
84
|
|
85
85
|
context "without rspec assertion and no content" do
|
86
86
|
Given(:rspec) { false }
|
87
87
|
Given(:content) { false }
|
88
|
-
Then { _gvn_need_na_message?(nassert).
|
88
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
92
|
context "with global configuration set to always" do
|
93
93
|
When { Given.use_natural_assertions :always }
|
94
|
-
Then { _gvn_need_na_message?(nassert).
|
94
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
95
95
|
|
96
96
|
context "overridden locally" do
|
97
97
|
use_natural_assertions false
|
98
|
-
Then { _gvn_need_na_message?(nassert).
|
98
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
99
99
|
end
|
100
100
|
|
101
101
|
context "with rspec assertion" do
|
102
102
|
Given(:rspec) { true }
|
103
|
-
Then { _gvn_need_na_message?(nassert).
|
103
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
104
104
|
end
|
105
105
|
|
106
106
|
context "without rspec assertion" do
|
107
107
|
Given(:rspec) { false }
|
108
|
-
Then { _gvn_need_na_message?(nassert).
|
108
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
109
109
|
end
|
110
110
|
|
111
111
|
context "without rspec assertion and no content" do
|
112
112
|
Given(:rspec) { false }
|
113
113
|
Given(:content) { false }
|
114
|
-
Then { _gvn_need_na_message?(nassert).
|
114
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
118
|
context "with global configuration disabled" do
|
119
119
|
When { Given.use_natural_assertions false }
|
120
|
-
Then { _gvn_need_na_message?(nassert).
|
120
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
121
121
|
|
122
122
|
context "overridden locally" do
|
123
123
|
use_natural_assertions_if_supported(true)
|
124
|
-
Then { _gvn_need_na_message?(nassert).
|
124
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_truthy }
|
125
125
|
end
|
126
126
|
|
127
127
|
context "with rspec assertion" do
|
128
128
|
Given(:rspec) { true }
|
129
|
-
Then { _gvn_need_na_message?(nassert).
|
129
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
130
130
|
end
|
131
131
|
|
132
132
|
context "without rspec assertion" do
|
133
133
|
Given(:rspec) { false }
|
134
|
-
Then { _gvn_need_na_message?(nassert).
|
134
|
+
Then { expect(_gvn_need_na_message?(nassert)).to be_falsy }
|
135
135
|
end
|
136
136
|
end
|
137
137
|
|