rspec-expectations 2.12.1 → 2.13.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.
Files changed (76) hide show
  1. data/Changelog.md +31 -0
  2. data/README.md +1 -1
  3. data/features/built_in_matchers/be.feature +6 -4
  4. data/features/built_in_matchers/be_within.feature +3 -1
  5. data/features/built_in_matchers/cover.feature +2 -0
  6. data/features/built_in_matchers/end_with.feature +2 -0
  7. data/features/built_in_matchers/equality.feature +9 -15
  8. data/features/built_in_matchers/exist.feature +2 -0
  9. data/features/built_in_matchers/expect_error.feature +14 -8
  10. data/features/built_in_matchers/have.feature +11 -5
  11. data/features/built_in_matchers/include.feature +53 -0
  12. data/features/built_in_matchers/match.feature +2 -0
  13. data/features/built_in_matchers/operators.feature +17 -11
  14. data/features/built_in_matchers/predicates.feature +21 -13
  15. data/features/built_in_matchers/respond_to.feature +7 -1
  16. data/features/built_in_matchers/satisfy.feature +2 -0
  17. data/features/built_in_matchers/start_with.feature +2 -0
  18. data/features/built_in_matchers/throw_symbol.feature +6 -0
  19. data/features/built_in_matchers/types.feature +8 -6
  20. data/lib/rspec/expectations/deprecation.rb +1 -1
  21. data/lib/rspec/expectations/differ.rb +8 -8
  22. data/lib/rspec/expectations/fail_with.rb +17 -3
  23. data/lib/rspec/expectations/syntax.rb +46 -0
  24. data/lib/rspec/expectations/version.rb +1 -1
  25. data/lib/rspec/matchers/built_in/be.rb +7 -3
  26. data/lib/rspec/matchers/built_in/be_within.rb +13 -4
  27. data/lib/rspec/matchers/built_in/change.rb +2 -2
  28. data/lib/rspec/matchers/built_in/equal.rb +5 -1
  29. data/lib/rspec/matchers/built_in/exist.rb +1 -1
  30. data/lib/rspec/matchers/built_in/have.rb +8 -8
  31. data/lib/rspec/matchers/built_in/include.rb +19 -3
  32. data/lib/rspec/matchers/built_in/respond_to.rb +1 -1
  33. data/lib/rspec/matchers/extensions/instance_eval_with_args.rb +1 -1
  34. data/lib/rspec/matchers/matcher.rb +4 -3
  35. data/lib/rspec/matchers/operator_matcher.rb +1 -1
  36. data/lib/rspec/matchers/pretty.rb +5 -1
  37. data/spec/rspec/expectations/differ_spec.rb +8 -15
  38. data/spec/rspec/expectations/expectation_target_spec.rb +18 -8
  39. data/spec/rspec/expectations/extensions/kernel_spec.rb +15 -15
  40. data/spec/rspec/expectations/fail_with_spec.rb +41 -16
  41. data/spec/rspec/expectations/handler_spec.rb +13 -13
  42. data/spec/rspec/expectations/syntax_spec.rb +70 -8
  43. data/spec/rspec/matchers/base_matcher_spec.rb +14 -12
  44. data/spec/rspec/matchers/be_close_spec.rb +1 -1
  45. data/spec/rspec/matchers/be_instance_of_spec.rb +14 -8
  46. data/spec/rspec/matchers/be_kind_of_spec.rb +12 -8
  47. data/spec/rspec/matchers/be_spec.rb +212 -148
  48. data/spec/rspec/matchers/be_within_spec.rb +91 -42
  49. data/spec/rspec/matchers/change_spec.rb +52 -38
  50. data/spec/rspec/matchers/configuration_spec.rb +19 -15
  51. data/spec/rspec/matchers/cover_spec.rb +19 -19
  52. data/spec/rspec/matchers/description_generation_spec.rb +86 -86
  53. data/spec/rspec/matchers/dsl_spec.rb +7 -7
  54. data/spec/rspec/matchers/eq_spec.rb +17 -11
  55. data/spec/rspec/matchers/eql_spec.rb +10 -10
  56. data/spec/rspec/matchers/equal_spec.rb +27 -9
  57. data/spec/rspec/matchers/exist_spec.rb +35 -21
  58. data/spec/rspec/matchers/has_spec.rb +33 -29
  59. data/spec/rspec/matchers/have_spec.rb +165 -151
  60. data/spec/rspec/matchers/include_matcher_integration_spec.rb +30 -0
  61. data/spec/rspec/matchers/include_spec.rb +282 -124
  62. data/spec/rspec/matchers/match_array_spec.rb +90 -49
  63. data/spec/rspec/matchers/match_spec.rb +21 -21
  64. data/spec/rspec/matchers/matcher_spec.rb +85 -48
  65. data/spec/rspec/matchers/matchers_spec.rb +12 -6
  66. data/spec/rspec/matchers/method_missing_spec.rb +5 -1
  67. data/spec/rspec/matchers/operator_matcher_spec.rb +216 -237
  68. data/spec/rspec/matchers/raise_error_spec.rb +132 -132
  69. data/spec/rspec/matchers/respond_to_spec.rb +109 -112
  70. data/spec/rspec/matchers/satisfy_spec.rb +16 -16
  71. data/spec/rspec/matchers/start_with_end_with_spec.rb +36 -32
  72. data/spec/rspec/matchers/throw_symbol_spec.rb +24 -24
  73. data/spec/rspec/matchers/yield_spec.rb +7 -7
  74. data/spec/spec_helper.rb +46 -19
  75. data/spec/support/in_sub_process.rb +27 -20
  76. metadata +81 -83
@@ -1,295 +1,292 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "should respond_to(:sym)" do
3
+ describe "expect(...).to respond_to(:sym)" do
4
4
  it_behaves_like "an RSpec matcher", :valid_value => "s", :invalid_value => 5 do
5
5
  let(:matcher) { respond_to(:upcase) }
6
6
  end
7
-
7
+
8
8
  it "passes if target responds to :sym" do
9
- Object.new.should respond_to(:methods)
9
+ expect(Object.new).to respond_to(:methods)
10
10
  end
11
-
11
+
12
12
  it "fails if target does not respond to :sym" do
13
- lambda {
14
- "this string".should respond_to(:some_method)
15
- }.should fail_with(%q|expected "this string" to respond to :some_method|)
13
+ expect {
14
+ expect("this string").to respond_to(:some_method)
15
+ }.to fail_with(%q|expected "this string" to respond to :some_method|)
16
16
  end
17
-
18
17
  end
19
18
 
20
- describe "should respond_to(:sym).with(1).argument" do
19
+ describe "expect(...).to respond_to(:sym).with(1).argument" do
21
20
  it "passes if target responds to :sym with 1 arg" do
22
21
  obj = Object.new
23
22
  def obj.foo(arg); end
24
- obj.should respond_to(:foo).with(1).argument
23
+ expect(obj).to respond_to(:foo).with(1).argument
25
24
  end
26
25
 
27
26
  it "passes if target responds to any number of arguments" do
28
27
  obj = Object.new
29
28
  def obj.foo(*args); end
30
- obj.should respond_to(:foo).with(1).argument
29
+ expect(obj).to respond_to(:foo).with(1).argument
31
30
  end
32
31
 
33
32
  it "passes if target responds to one or more arguments" do
34
33
  obj = Object.new
35
34
  def obj.foo(a, *args); end
36
- obj.should respond_to(:foo).with(1).argument
35
+ expect(obj).to respond_to(:foo).with(1).argument
37
36
  end
38
-
37
+
39
38
  it "fails if target does not respond to :sym" do
40
39
  obj = Object.new
41
- lambda {
42
- obj.should respond_to(:some_method).with(1).argument
43
- }.should fail_with(/expected .* to respond to :some_method/)
40
+ expect {
41
+ expect(obj).to respond_to(:some_method).with(1).argument
42
+ }.to fail_with(/expected .* to respond to :some_method/)
44
43
  end
45
-
44
+
46
45
  it "fails if :sym expects 0 args" do
47
46
  obj = Object.new
48
47
  def obj.foo; end
49
- lambda {
50
- obj.should respond_to(:foo).with(1).argument
51
- }.should fail_with(/expected #<Object.*> to respond to :foo with 1 argument/)
48
+ expect {
49
+ expect(obj).to respond_to(:foo).with(1).argument
50
+ }.to fail_with(/expected #<Object.*> to respond to :foo with 1 argument/)
52
51
  end
53
-
52
+
54
53
  it "fails if :sym expects 2 args" do
55
54
  obj = Object.new
56
55
  def obj.foo(arg, arg2); end
57
- lambda {
58
- obj.should respond_to(:foo).with(1).argument
59
- }.should fail_with(/expected #<Object.*> to respond to :foo with 1 argument/)
56
+ expect {
57
+ expect(obj).to respond_to(:foo).with(1).argument
58
+ }.to fail_with(/expected #<Object.*> to respond to :foo with 1 argument/)
60
59
  end
61
60
 
62
61
  it "fails if :sym expects 2 or more args" do
63
62
  obj = Object.new
64
63
  def obj.foo(arg, arg2, *args); end
65
- lambda {
66
- obj.should respond_to(:foo).with(1).argument
67
- }.should fail_with(/expected #<Object.*> to respond to :foo with 1 argument/)
64
+ expect {
65
+ expect(obj).to respond_to(:foo).with(1).argument
66
+ }.to fail_with(/expected #<Object.*> to respond to :foo with 1 argument/)
68
67
  end
69
68
  end
70
69
 
71
- describe "should respond_to(message1, message2)" do
72
-
70
+ describe "expect(...).to respond_to(message1, message2)" do
73
71
  it "passes if target responds to both messages" do
74
- Object.new.should respond_to('methods', 'inspect')
72
+ expect(Object.new).to respond_to('methods', 'inspect')
75
73
  end
76
-
74
+
77
75
  it "fails if target does not respond to first message" do
78
- lambda {
79
- Object.new.should respond_to('method_one', 'inspect')
80
- }.should fail_with(/expected #<Object:.*> to respond to "method_one"/)
76
+ expect {
77
+ expect(Object.new).to respond_to('method_one', 'inspect')
78
+ }.to fail_with(/expected #<Object:.*> to respond to "method_one"/)
81
79
  end
82
-
80
+
83
81
  it "fails if target does not respond to second message" do
84
- lambda {
85
- Object.new.should respond_to('inspect', 'method_one')
86
- }.should fail_with(/expected #<Object:.*> to respond to "method_one"/)
82
+ expect {
83
+ expect(Object.new).to respond_to('inspect', 'method_one')
84
+ }.to fail_with(/expected #<Object:.*> to respond to "method_one"/)
87
85
  end
88
-
86
+
89
87
  it "fails if target does not respond to either message" do
90
- lambda {
91
- Object.new.should respond_to('method_one', 'method_two')
92
- }.should fail_with(/expected #<Object:.*> to respond to "method_one", "method_two"/)
88
+ expect {
89
+ expect(Object.new).to respond_to('method_one', 'method_two')
90
+ }.to fail_with(/expected #<Object:.*> to respond to "method_one", "method_two"/)
93
91
  end
94
92
  end
95
93
 
96
- describe "should respond_to(:sym).with(2).arguments" do
94
+ describe "expect(...).to respond_to(:sym).with(2).arguments" do
97
95
  it "passes if target responds to :sym with 2 args" do
98
96
  obj = Object.new
99
97
  def obj.foo(a1, a2); end
100
- obj.should respond_to(:foo).with(2).arguments
98
+ expect(obj).to respond_to(:foo).with(2).arguments
101
99
  end
102
100
 
103
101
  it "passes if target responds to any number of arguments" do
104
102
  obj = Object.new
105
103
  def obj.foo(*args); end
106
- obj.should respond_to(:foo).with(2).arguments
104
+ expect(obj).to respond_to(:foo).with(2).arguments
107
105
  end
108
106
 
109
107
  it "passes if target responds to one or more arguments" do
110
108
  obj = Object.new
111
109
  def obj.foo(a, *args); end
112
- obj.should respond_to(:foo).with(2).arguments
110
+ expect(obj).to respond_to(:foo).with(2).arguments
113
111
  end
114
112
 
115
113
  it "passes if target responds to two or more arguments" do
116
114
  obj = Object.new
117
115
  def obj.foo(a, b, *args); end
118
- obj.should respond_to(:foo).with(2).arguments
116
+ expect(obj).to respond_to(:foo).with(2).arguments
119
117
  end
120
-
118
+
121
119
  it "fails if target does not respond to :sym" do
122
120
  obj = Object.new
123
- lambda {
124
- obj.should respond_to(:some_method).with(2).arguments
125
- }.should fail_with(/expected .* to respond to :some_method/)
121
+ expect {
122
+ expect(obj).to respond_to(:some_method).with(2).arguments
123
+ }.to fail_with(/expected .* to respond to :some_method/)
126
124
  end
127
-
125
+
128
126
  it "fails if :sym expects 0 args" do
129
127
  obj = Object.new
130
128
  def obj.foo; end
131
- lambda {
132
- obj.should respond_to(:foo).with(2).arguments
133
- }.should fail_with(/expected #<Object.*> to respond to :foo with 2 arguments/)
129
+ expect {
130
+ expect(obj).to respond_to(:foo).with(2).arguments
131
+ }.to fail_with(/expected #<Object.*> to respond to :foo with 2 arguments/)
134
132
  end
135
-
133
+
136
134
  it "fails if :sym expects 1 args" do
137
135
  obj = Object.new
138
136
  def obj.foo(arg); end
139
- lambda {
140
- obj.should respond_to(:foo).with(2).arguments
141
- }.should fail_with(/expected #<Object.*> to respond to :foo with 2 arguments/)
137
+ expect {
138
+ expect(obj).to respond_to(:foo).with(2).arguments
139
+ }.to fail_with(/expected #<Object.*> to respond to :foo with 2 arguments/)
142
140
  end
143
141
 
144
142
  it "fails if :sym expects 3 or more args" do
145
143
  obj = Object.new
146
144
  def obj.foo(arg, arg2, arg3, *args); end
147
- lambda {
148
- obj.should respond_to(:foo).with(2).arguments
149
- }.should fail_with(/expected #<Object.*> to respond to :foo with 2 arguments/)
145
+ expect {
146
+ expect(obj).to respond_to(:foo).with(2).arguments
147
+ }.to fail_with(/expected #<Object.*> to respond to :foo with 2 arguments/)
150
148
  end
151
149
  end
152
150
 
153
- describe "should_not respond_to(:sym)" do
154
-
151
+ describe "expect(...).to_not respond_to(:sym)" do
155
152
  it "passes if target does not respond to :sym" do
156
- Object.new.should_not respond_to(:some_method)
153
+ expect(Object.new).not_to respond_to(:some_method)
157
154
  end
158
-
155
+
159
156
  it "fails if target responds to :sym" do
160
- lambda {
161
- Object.new.should_not respond_to(:methods)
162
- }.should fail_with(/expected #<Object:.*> not to respond to :methods/)
157
+ expect {
158
+ expect(Object.new).not_to respond_to(:methods)
159
+ }.to fail_with(/expected #<Object:.*> not to respond to :methods/)
163
160
  end
164
-
165
161
  end
166
162
 
167
- describe "should_not respond_to(:sym).with(1).argument" do
163
+ describe "expect(...).to_not respond_to(:sym).with(1).argument" do
168
164
  it "fails if target responds to :sym with 1 arg" do
169
165
  obj = Object.new
170
166
  def obj.foo(arg); end
171
- lambda {
172
- obj.should_not respond_to(:foo).with(1).argument
173
- }.should fail_with(/expected #<Object:.*> not to respond to :foo with 1 argument/)
167
+ expect {
168
+ expect(obj).not_to respond_to(:foo).with(1).argument
169
+ }.to fail_with(/expected #<Object:.*> not to respond to :foo with 1 argument/)
174
170
  end
175
171
 
176
172
  it "fails if target responds to :sym with any number of args" do
177
173
  obj = Object.new
178
174
  def obj.foo(*args); end
179
- lambda {
180
- obj.should_not respond_to(:foo).with(1).argument
181
- }.should fail_with(/expected #<Object:.*> not to respond to :foo with 1 argument/)
175
+ expect {
176
+ expect(obj).not_to respond_to(:foo).with(1).argument
177
+ }.to fail_with(/expected #<Object:.*> not to respond to :foo with 1 argument/)
182
178
  end
183
179
 
184
180
  it "fails if target responds to :sym with one or more args" do
185
181
  obj = Object.new
186
182
  def obj.foo(a, *args); end
187
- lambda {
188
- obj.should_not respond_to(:foo).with(1).argument
189
- }.should fail_with(/expected #<Object:.*> not to respond to :foo with 1 argument/)
183
+ expect {
184
+ expect(obj).not_to respond_to(:foo).with(1).argument
185
+ }.to fail_with(/expected #<Object:.*> not to respond to :foo with 1 argument/)
190
186
  end
191
187
 
192
188
  it "passes if target does not respond to :sym" do
193
189
  obj = Object.new
194
- obj.should_not respond_to(:some_method).with(1).argument
190
+ expect(obj).not_to respond_to(:some_method).with(1).argument
195
191
  end
196
192
 
197
193
  it "passes if :sym expects 0 args" do
198
194
  obj = Object.new
199
195
  def obj.foo; end
200
- obj.should_not respond_to(:foo).with(1).argument
196
+ expect(obj).not_to respond_to(:foo).with(1).argument
201
197
  end
202
198
 
203
199
  it "passes if :sym expects 2 args" do
204
200
  obj = Object.new
205
201
  def obj.foo(arg, arg2); end
206
- obj.should_not respond_to(:foo).with(1).argument
202
+ expect(obj).not_to respond_to(:foo).with(1).argument
207
203
  end
208
204
 
209
205
  it "passes if :sym expects 2 or more args" do
210
206
  obj = Object.new
211
207
  def obj.foo(arg, arg2, *args); end
212
- obj.should_not respond_to(:foo).with(1).argument
208
+ expect(obj).not_to respond_to(:foo).with(1).argument
213
209
  end
214
210
  end
215
211
 
216
- describe "should_not respond_to(message1, message2)" do
212
+ describe "expect(...).to_not respond_to(message1, message2)" do
217
213
  it "passes if target does not respond to either message1 or message2" do
218
- Object.new.should_not respond_to(:some_method, :some_other_method)
214
+ expect(Object.new).not_to respond_to(:some_method, :some_other_method)
219
215
  end
220
216
 
221
217
  it "fails if target responds to message1 but not message2" do
222
- lambda {
223
- Object.new.should_not respond_to(:object_id, :some_method)
224
- }.should fail_with(/expected #<Object:.*> not to respond to :object_id/)
218
+ expect {
219
+ expect(Object.new).not_to respond_to(:object_id, :some_method)
220
+ }.to fail_with(/expected #<Object:.*> not to respond to :object_id/)
225
221
  end
226
222
 
227
223
  it "fails if target responds to message2 but not message1" do
228
- lambda {
229
- Object.new.should_not respond_to(:some_method, :object_id)
230
- }.should fail_with(/expected #<Object:.*> not to respond to :object_id/)
224
+ expect {
225
+ expect(Object.new).not_to respond_to(:some_method, :object_id)
226
+ }.to fail_with(/expected #<Object:.*> not to respond to :object_id/)
231
227
  end
232
228
 
233
229
  it "fails if target responds to both message1 and message2" do
234
- lambda {
235
- Object.new.should_not respond_to(:class, :object_id)
236
- }.should fail_with(/expected #<Object:.*> not to respond to :class, :object_id/)
230
+ expect {
231
+ expect(Object.new).not_to respond_to(:class, :object_id)
232
+ }.to fail_with(/expected #<Object:.*> not to respond to :class, :object_id/)
237
233
  end
238
234
  end
239
235
 
240
- describe "should_not respond_to(:sym).with(2).arguments" do
236
+ describe "expect(...).to_not respond_to(:sym).with(2).arguments" do
241
237
  it "fails if target responds to :sym with 2 args" do
242
238
  obj = Object.new
243
239
  def obj.foo(a1, a2); end
244
- lambda {
245
- obj.should_not respond_to(:foo).with(2).arguments
246
- }.should fail_with(/expected .* not to respond to :foo with 2 arguments/)
240
+ expect {
241
+ expect(obj).not_to respond_to(:foo).with(2).arguments
242
+ }.to fail_with(/expected .* not to respond to :foo with 2 arguments/)
247
243
  end
248
244
 
249
245
  it "fails if target responds to :sym with any number args" do
250
246
  obj = Object.new
251
247
  def obj.foo(*args); end
252
- lambda {
253
- obj.should_not respond_to(:foo).with(2).arguments
254
- }.should fail_with(/expected .* not to respond to :foo with 2 arguments/)
248
+ expect {
249
+ expect(obj).not_to respond_to(:foo).with(2).arguments
250
+ }.to fail_with(/expected .* not to respond to :foo with 2 arguments/)
255
251
  end
256
252
 
257
253
  it "fails if target responds to :sym with one or more args" do
258
254
  obj = Object.new
259
255
  def obj.foo(a, *args); end
260
- lambda {
261
- obj.should_not respond_to(:foo).with(2).arguments
262
- }.should fail_with(/expected .* not to respond to :foo with 2 arguments/)
256
+ expect {
257
+ expect(obj).not_to respond_to(:foo).with(2).arguments
258
+ }.to fail_with(/expected .* not to respond to :foo with 2 arguments/)
263
259
  end
264
260
 
265
261
  it "fails if target responds to :sym with two or more args" do
266
262
  obj = Object.new
267
263
  def obj.foo(a, b, *args); end
268
- lambda {
269
- obj.should_not respond_to(:foo).with(2).arguments
270
- }.should fail_with(/expected .* not to respond to :foo with 2 arguments/)
264
+ expect {
265
+ expect(obj).not_to respond_to(:foo).with(2).arguments
266
+ }.to fail_with(/expected .* not to respond to :foo with 2 arguments/)
271
267
  end
272
268
 
273
269
  it "passes if target does not respond to :sym" do
274
270
  obj = Object.new
275
- obj.should_not respond_to(:some_method).with(2).arguments
271
+ expect(obj).not_to respond_to(:some_method).with(2).arguments
276
272
  end
277
273
 
278
274
  it "passes if :sym expects 0 args" do
279
275
  obj = Object.new
280
276
  def obj.foo; end
281
- obj.should_not respond_to(:foo).with(2).arguments
277
+ expect(obj).not_to respond_to(:foo).with(2).arguments
282
278
  end
283
279
 
284
280
  it "passes if :sym expects 2 args" do
285
281
  obj = Object.new
286
282
  def obj.foo(arg); end
287
- obj.should_not respond_to(:foo).with(2).arguments
283
+ expect(obj).not_to respond_to(:foo).with(2).arguments
288
284
  end
289
285
 
290
286
  it "passes if :sym expects 3 or more args" do
291
287
  obj = Object.new
292
288
  def obj.foo(a, b, c, *arg); end
293
- obj.should_not respond_to(:foo).with(2).arguments
289
+ expect(obj).not_to respond_to(:foo).with(2).arguments
294
290
  end
295
291
  end
292
+
@@ -1,44 +1,44 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "should satisfy { block }" do
3
+ describe "expect(...).to satisfy { block }" do
4
4
  it_behaves_like "an RSpec matcher", :valid_value => true, :invalid_value => false do
5
5
  let(:matcher) { satisfy { |v| v } }
6
6
  end
7
7
 
8
8
  it "describes itself" do
9
- satisfy.description.should eq("satisfy block")
9
+ expect(satisfy.description).to eq("satisfy block")
10
10
  end
11
11
 
12
12
  it "passes if block returns true" do
13
- true.should satisfy { |val| val }
14
- true.should satisfy do |val|
13
+ expect(true).to satisfy { |val| val }
14
+ expect(true).to satisfy do |val|
15
15
  val
16
16
  end
17
17
  end
18
18
 
19
19
  it "fails if block returns false" do
20
- lambda {
21
- false.should satisfy { |val| val }
22
- }.should fail_with("expected false to satisfy block")
23
- lambda do
24
- false.should satisfy do |val|
20
+ expect {
21
+ expect(false).to satisfy { |val| val }
22
+ }.to fail_with("expected false to satisfy block")
23
+ expect do
24
+ expect(false).to satisfy do |val|
25
25
  val
26
26
  end
27
- end.should fail_with("expected false to satisfy block")
27
+ end.to fail_with("expected false to satisfy block")
28
28
  end
29
29
  end
30
30
 
31
- describe "should_not satisfy { block }" do
31
+ describe "expect(...).to_not satisfy { block }" do
32
32
  it "passes if block returns false" do
33
- false.should_not satisfy { |val| val }
34
- false.should_not satisfy do |val|
33
+ expect(false).not_to satisfy { |val| val }
34
+ expect(false).not_to satisfy do |val|
35
35
  val
36
36
  end
37
37
  end
38
38
 
39
39
  it "fails if block returns true" do
40
- lambda {
41
- true.should_not satisfy { |val| val }
42
- }.should fail_with("expected true not to satisfy block")
40
+ expect {
41
+ expect(true).not_to satisfy { |val| val }
42
+ }.to fail_with("expected true not to satisfy block")
43
43
  end
44
44
  end