assert 2.18.3 → 2.19.3
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 +4 -2
- data/assert.gemspec +11 -5
- data/bin/assert +1 -0
- data/lib/assert.rb +20 -6
- data/lib/assert/actual_value.rb +26 -8
- data/lib/assert/assert_runner.rb +38 -17
- data/lib/assert/assertions.rb +145 -41
- data/lib/assert/cli.rb +19 -66
- data/lib/assert/clirb.rb +55 -0
- data/lib/assert/config.rb +9 -7
- data/lib/assert/config_helpers.rb +57 -22
- data/lib/assert/context.rb +33 -49
- data/lib/assert/context/let_dsl.rb +10 -4
- data/lib/assert/context/method_missing.rb +3 -0
- data/lib/assert/context/setup_dsl.rb +24 -16
- data/lib/assert/context/subject_dsl.rb +26 -25
- data/lib/assert/context/suite_dsl.rb +5 -1
- data/lib/assert/context/test_dsl.rb +58 -19
- data/lib/assert/context_info.rb +2 -0
- data/lib/assert/default_runner.rb +2 -0
- data/lib/assert/default_suite.rb +27 -15
- data/lib/assert/default_view.rb +49 -30
- data/lib/assert/factory.rb +2 -0
- data/lib/assert/file_line.rb +8 -6
- data/lib/assert/macro.rb +3 -1
- data/lib/assert/macros/methods.rb +73 -45
- data/lib/assert/result.rb +117 -61
- data/lib/assert/runner.rb +70 -51
- data/lib/assert/stub.rb +44 -3
- data/lib/assert/suite.rb +76 -38
- data/lib/assert/test.rb +43 -44
- data/lib/assert/utils.rb +22 -11
- data/lib/assert/version.rb +3 -1
- data/lib/assert/view.rb +46 -18
- data/lib/assert/view_helpers.rb +102 -92
- data/test/helper.rb +8 -4
- data/test/support/factory.rb +40 -21
- data/test/support/inherited_stuff.rb +2 -0
- data/test/system/stub_tests.rb +272 -250
- data/test/system/test_tests.rb +89 -73
- data/test/unit/actual_value_tests.rb +103 -46
- data/test/unit/assert_tests.rb +49 -39
- data/test/unit/assertions/assert_block_tests.rb +14 -14
- data/test/unit/assertions/assert_changes_tests.rb +103 -0
- data/test/unit/assertions/assert_empty_tests.rb +18 -16
- data/test/unit/assertions/assert_equal_tests.rb +48 -32
- data/test/unit/assertions/assert_file_exists_tests.rb +19 -17
- data/test/unit/assertions/assert_includes_tests.rb +14 -14
- data/test/unit/assertions/assert_instance_of_tests.rb +18 -18
- data/test/unit/assertions/assert_is_a_tests.rb +128 -0
- data/test/unit/assertions/assert_match_tests.rb +14 -14
- data/test/unit/assertions/assert_nil_tests.rb +20 -16
- data/test/unit/assertions/assert_raises_tests.rb +36 -27
- data/test/unit/assertions/assert_respond_to_tests.rb +14 -14
- data/test/unit/assertions/assert_same_tests.rb +28 -32
- data/test/unit/assertions/assert_true_false_tests.rb +38 -32
- data/test/unit/assertions_tests.rb +25 -18
- data/test/unit/config_helpers_tests.rb +20 -9
- data/test/unit/config_tests.rb +16 -8
- data/test/unit/context/let_dsl_tests.rb +2 -0
- data/test/unit/context/setup_dsl_tests.rb +27 -15
- data/test/unit/context/subject_dsl_tests.rb +5 -4
- data/test/unit/context/suite_dsl_tests.rb +6 -5
- data/test/unit/context/test_dsl_tests.rb +43 -19
- data/test/unit/context_info_tests.rb +12 -3
- data/test/unit/context_tests.rb +166 -116
- data/test/unit/default_runner_tests.rb +2 -0
- data/test/unit/default_suite_tests.rb +17 -5
- data/test/unit/factory_tests.rb +5 -1
- data/test/unit/file_line_tests.rb +14 -12
- data/test/unit/macro_tests.rb +17 -10
- data/test/unit/result_tests.rb +72 -75
- data/test/unit/runner_tests.rb +38 -23
- data/test/unit/suite_tests.rb +48 -30
- data/test/unit/test_tests.rb +88 -102
- data/test/unit/utils_tests.rb +53 -36
- data/test/unit/view_helpers_tests.rb +25 -17
- data/test/unit/view_tests.rb +8 -5
- metadata +40 -9
- data/test/unit/assertions/assert_kind_of_tests.rb +0 -68
data/test/system/test_tests.rb
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
|
3
5
|
class Assert::Test
|
4
|
-
|
5
6
|
class SystemTests < Assert::Context
|
6
7
|
include Assert::Test::TestHelpers
|
7
8
|
|
8
9
|
desc "Assert::Test"
|
9
|
-
subject { test1 }
|
10
10
|
|
11
11
|
setup do
|
12
|
-
|
12
|
+
subject.run(&test_run_callback)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
class NoResultsTests < SystemTests
|
17
17
|
desc "when producing no results"
|
18
|
-
|
19
|
-
let(:test1) { Factory.test }
|
18
|
+
subject{ Factory.test }
|
20
19
|
|
21
20
|
should "generate 0 results" do
|
22
21
|
assert_that(test_run_result_count).equals(0)
|
@@ -25,8 +24,13 @@ class Assert::Test
|
|
25
24
|
|
26
25
|
class PassTests < SystemTests
|
27
26
|
desc "when passing a single assertion"
|
28
|
-
|
29
|
-
|
27
|
+
subject do
|
28
|
+
Factory.test do
|
29
|
+
assert(
|
30
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
30
34
|
|
31
35
|
should "generate 1 result" do
|
32
36
|
assert_that(test_run_result_count).equals(1)
|
@@ -39,8 +43,7 @@ class Assert::Test
|
|
39
43
|
|
40
44
|
class FailTests < SystemTests
|
41
45
|
desc "when failing a single assertion"
|
42
|
-
|
43
|
-
let(:test1) { Factory.test{ assert(1 == 0) } }
|
46
|
+
subject{ Factory.test{ assert(1 == 0) } }
|
44
47
|
|
45
48
|
should "generate 1 result" do
|
46
49
|
assert_that(test_run_result_count).equals(1)
|
@@ -53,8 +56,7 @@ class Assert::Test
|
|
53
56
|
|
54
57
|
class SkipTests < SystemTests
|
55
58
|
desc "when skipping once"
|
56
|
-
|
57
|
-
let(:test1) { Factory.test{ skip } }
|
59
|
+
subject{ Factory.test{ skip } }
|
58
60
|
|
59
61
|
should "generate 1 result" do
|
60
62
|
assert_that(test_run_result_count).equals(1)
|
@@ -67,8 +69,7 @@ class Assert::Test
|
|
67
69
|
|
68
70
|
class ErrorTests < SystemTests
|
69
71
|
desc "when erroring once"
|
70
|
-
|
71
|
-
let(:test1) { Factory.test{ raise("WHAT") } }
|
72
|
+
subject{ Factory.test{ raise("WHAT") } }
|
72
73
|
|
73
74
|
should "generate 1 result" do
|
74
75
|
assert_that(test_run_result_count).equals(1)
|
@@ -81,13 +82,14 @@ class Assert::Test
|
|
81
82
|
|
82
83
|
class MixedTests < SystemTests
|
83
84
|
desc "when passing 1 assertion and failing 1 assertion"
|
84
|
-
|
85
|
-
let(:test1) {
|
85
|
+
subject do
|
86
86
|
Factory.test do
|
87
|
-
assert(
|
87
|
+
assert(
|
88
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
89
|
+
)
|
88
90
|
assert(1 == 0)
|
89
91
|
end
|
90
|
-
|
92
|
+
end
|
91
93
|
|
92
94
|
should "generate 2 total results" do
|
93
95
|
assert_that(test_run_result_count).equals(2)
|
@@ -103,15 +105,17 @@ class Assert::Test
|
|
103
105
|
end
|
104
106
|
|
105
107
|
class MixedSkipTests < SystemTests
|
106
|
-
desc "when passing 1 assertion and failing 1 assertion with a skip call
|
107
|
-
|
108
|
-
|
108
|
+
desc "when passing 1 assertion and failing 1 assertion with a skip call "\
|
109
|
+
"in between"
|
110
|
+
subject do
|
109
111
|
Factory.test do
|
110
|
-
assert(
|
112
|
+
assert(
|
113
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
114
|
+
)
|
111
115
|
skip
|
112
116
|
assert(1 == 0)
|
113
117
|
end
|
114
|
-
|
118
|
+
end
|
115
119
|
|
116
120
|
should "generate 2 total results" do
|
117
121
|
assert_that(test_run_result_count).equals(2)
|
@@ -135,15 +139,17 @@ class Assert::Test
|
|
135
139
|
end
|
136
140
|
|
137
141
|
class MixedErrorTests < SystemTests
|
138
|
-
desc "when passing 1 assertion and failing 1 assertion with an exception
|
139
|
-
|
140
|
-
|
142
|
+
desc "when passing 1 assertion and failing 1 assertion with an exception "\
|
143
|
+
"raised in between"
|
144
|
+
subject do
|
141
145
|
Factory.test do
|
142
|
-
assert(
|
143
|
-
|
144
|
-
|
146
|
+
assert(
|
147
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
148
|
+
)
|
149
|
+
raise "something errored"
|
150
|
+
assert(1 == 0) # rubocop:disable Lint/UnreachableCode
|
145
151
|
end
|
146
|
-
|
152
|
+
end
|
147
153
|
|
148
154
|
should "generate 2 total results" do
|
149
155
|
assert_that(test_run_result_count).equals(2)
|
@@ -167,15 +173,17 @@ class Assert::Test
|
|
167
173
|
end
|
168
174
|
|
169
175
|
class MixedPassTests < SystemTests
|
170
|
-
desc "when passing 1 assertion and failing 1 assertion with a pass call
|
171
|
-
|
172
|
-
|
176
|
+
desc "when passing 1 assertion and failing 1 assertion with a pass call "\
|
177
|
+
"in between"
|
178
|
+
subject do
|
173
179
|
Factory.test do
|
174
|
-
assert(
|
180
|
+
assert(
|
181
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
182
|
+
)
|
175
183
|
pass
|
176
184
|
assert(1 == 0)
|
177
185
|
end
|
178
|
-
|
186
|
+
end
|
179
187
|
|
180
188
|
should "generate 3 total results" do
|
181
189
|
assert_that(test_run_result_count).equals(3)
|
@@ -195,15 +203,17 @@ class Assert::Test
|
|
195
203
|
end
|
196
204
|
|
197
205
|
class MixedFailTests < SystemTests
|
198
|
-
desc "when failing 1 assertion and passing 1 assertion with a fail call
|
199
|
-
|
200
|
-
|
206
|
+
desc "when failing 1 assertion and passing 1 assertion with a fail call "\
|
207
|
+
"in between"
|
208
|
+
subject do
|
201
209
|
Factory.test do
|
202
210
|
assert(1 == 0)
|
203
|
-
fail
|
204
|
-
assert(
|
211
|
+
fail # rubocop:disable Style/SignalException
|
212
|
+
assert( # rubocop:disable Lint/UnreachableCode
|
213
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
214
|
+
)
|
205
215
|
end
|
206
|
-
|
216
|
+
end
|
207
217
|
|
208
218
|
should "generate 3 total results" do
|
209
219
|
assert_that(test_run_result_count).equals(3)
|
@@ -223,15 +233,17 @@ class Assert::Test
|
|
223
233
|
end
|
224
234
|
|
225
235
|
class MixedFlunkTests < SystemTests
|
226
|
-
desc "has failing 1 assertion and passing 1 assertion with a flunk call
|
227
|
-
|
228
|
-
|
236
|
+
desc "has failing 1 assertion and passing 1 assertion with a flunk call "\
|
237
|
+
"in between"
|
238
|
+
subject do
|
229
239
|
Factory.test do
|
230
240
|
assert(1 == 0)
|
231
241
|
flunk
|
232
|
-
assert(
|
242
|
+
assert(
|
243
|
+
1 == 1, # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
|
244
|
+
)
|
233
245
|
end
|
234
|
-
|
246
|
+
end
|
235
247
|
|
236
248
|
should "generate 3 total results" do
|
237
249
|
assert_that(test_run_result_count).equals(3)
|
@@ -252,18 +264,20 @@ class Assert::Test
|
|
252
264
|
|
253
265
|
class WithSetupsTests < SystemTests
|
254
266
|
desc "that has setup logic"
|
267
|
+
subject do
|
268
|
+
Factory.test("t", Factory.context_info(context_class1)){ pass "TEST" }
|
269
|
+
end
|
255
270
|
|
256
|
-
let(:context_class1)
|
271
|
+
let(:context_class1) do
|
257
272
|
Factory.context_class do
|
258
273
|
# assert style
|
259
|
-
setup
|
274
|
+
setup{ pass "assert style setup" }
|
260
275
|
# test/unit style
|
261
|
-
def setup
|
276
|
+
def setup
|
277
|
+
pass "test/unit style setup"
|
278
|
+
end
|
262
279
|
end
|
263
|
-
|
264
|
-
let(:test1) {
|
265
|
-
Factory.test("t", Factory.context_info(context_class1)) { pass "TEST" }
|
266
|
-
}
|
280
|
+
end
|
267
281
|
|
268
282
|
should "execute all setup logic when run" do
|
269
283
|
assert_that(test_run_result_count(:pass)).equals(3)
|
@@ -275,18 +289,20 @@ class Assert::Test
|
|
275
289
|
|
276
290
|
class WithTeardownsTests < SystemTests
|
277
291
|
desc "that has teardown logic"
|
292
|
+
subject do
|
293
|
+
Factory.test("t", Factory.context_info(context_class1)){ pass "TEST" }
|
294
|
+
end
|
278
295
|
|
279
|
-
let(:context_class1)
|
296
|
+
let(:context_class1) do
|
280
297
|
Factory.context_class do
|
281
298
|
# assert style
|
282
|
-
teardown
|
299
|
+
teardown{ pass "assert style teardown" }
|
283
300
|
# test/unit style
|
284
|
-
def teardown
|
301
|
+
def teardown
|
302
|
+
pass "test/unit style teardown"
|
303
|
+
end
|
285
304
|
end
|
286
|
-
|
287
|
-
let(:test1) {
|
288
|
-
Factory.test("t", Factory.context_info(context_class1)) { pass "TEST" }
|
289
|
-
}
|
305
|
+
end
|
290
306
|
|
291
307
|
should "execute all teardown logic when run" do
|
292
308
|
assert_that(test_run_result_count(:pass)).equals(3)
|
@@ -298,39 +314,39 @@ class Assert::Test
|
|
298
314
|
|
299
315
|
class WithAroundsTests < SystemTests
|
300
316
|
desc "that has around logic (in addition to setups/teardowns)"
|
317
|
+
subject do
|
318
|
+
Factory.test("t", Factory.context_info(context_class1)){ pass "TEST" }
|
319
|
+
end
|
301
320
|
|
302
|
-
let(:parent_context_class1)
|
321
|
+
let(:parent_context_class1) do
|
303
322
|
Factory.modes_off_context_class do
|
304
323
|
around do |block|
|
305
324
|
pass "parent around start"
|
306
325
|
block.call
|
307
326
|
pass "parent around end"
|
308
327
|
end
|
309
|
-
setup
|
310
|
-
teardown
|
328
|
+
setup{ pass "parent setup" }
|
329
|
+
teardown{ pass "parent teardown" }
|
311
330
|
end
|
312
|
-
|
313
|
-
let(:context_class1)
|
331
|
+
end
|
332
|
+
let(:context_class1) do
|
314
333
|
Factory.modes_off_context_class(parent_context_class1) do
|
315
|
-
setup
|
334
|
+
setup{ pass "child setup1" }
|
316
335
|
around do |block|
|
317
336
|
pass "child around1 start"
|
318
337
|
block.call
|
319
338
|
pass "child around1 end"
|
320
339
|
end
|
321
|
-
teardown
|
322
|
-
setup
|
340
|
+
teardown{ pass "child teardown1" }
|
341
|
+
setup{ pass "child setup2" }
|
323
342
|
around do |block|
|
324
343
|
pass "child around2 start"
|
325
344
|
block.call
|
326
345
|
pass "child around2 end"
|
327
346
|
end
|
328
|
-
teardown
|
347
|
+
teardown{ pass "child teardown2" }
|
329
348
|
end
|
330
|
-
|
331
|
-
let(:test1) {
|
332
|
-
Factory.test("t", Factory.context_info(context_class1)) { pass "TEST" }
|
333
|
-
}
|
349
|
+
end
|
334
350
|
|
335
351
|
should "run the arounds outside of the setups/teardowns/test" do
|
336
352
|
assert_that(test_run_result_count(:pass)).equals(13)
|
@@ -339,7 +355,7 @@ class Assert::Test
|
|
339
355
|
"parent around start", "child around1 start", "child around2 start",
|
340
356
|
"parent setup", "child setup1", "child setup2", "TEST",
|
341
357
|
"child teardown1", "child teardown2", "parent teardown",
|
342
|
-
"child around2 end", "child around1 end", "parent around end"
|
358
|
+
"child around2 end", "child around1 end", "parent around end",
|
343
359
|
]
|
344
360
|
assert_that(test_run_result_messages).equals(exp)
|
345
361
|
end
|
@@ -1,29 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "assert"
|
2
4
|
require "assert/actual_value"
|
3
5
|
|
4
6
|
class Assert::ActualValue
|
5
7
|
class UnitTests < Assert::Context
|
6
8
|
desc "Assert::ActualValue"
|
7
|
-
subject
|
9
|
+
subject{ unit_class }
|
8
10
|
|
9
|
-
let(:unit_class)
|
11
|
+
let(:unit_class){ Assert::ActualValue }
|
10
12
|
end
|
11
13
|
|
12
14
|
class InitTests < UnitTests
|
13
15
|
desc "when init"
|
14
|
-
subject
|
16
|
+
subject{ unit_class.new(actual_value1, context: context1) }
|
15
17
|
|
16
|
-
let(:actual_value1)
|
17
|
-
let(:context1)
|
18
|
+
let(:actual_value1){ Factory.string }
|
19
|
+
let(:context1){ Factory.modes_off_context }
|
18
20
|
|
19
21
|
should have_imeths :returns_true, :does_not_return_true
|
20
22
|
should have_imeths :raises, :does_not_raise
|
23
|
+
should have_imeths :changes, :does_not_change
|
24
|
+
should have_imeths :is_a, :is_not_a
|
21
25
|
should have_imeths :is_a_kind_of, :is_not_a_kind_of
|
22
26
|
should have_imeths :is_kind_of, :is_not_kind_of
|
23
27
|
should have_imeths :is_an_instance_of, :is_not_an_instance_of
|
24
28
|
should have_imeths :is_instance_of, :is_not_instance_of
|
25
29
|
should have_imeths :responds_to, :does_not_respond_to
|
26
30
|
should have_imeths :is_the_same_as, :is_not_the_same_as
|
31
|
+
should have_imeths :is, :is_not
|
27
32
|
should have_imeths :equals, :does_not_equal
|
28
33
|
should have_imeths :is_equal_to, :is_not_equal_to
|
29
34
|
should have_imeths :matches, :does_not_match
|
@@ -38,14 +43,14 @@ class Assert::ActualValue
|
|
38
43
|
class MethodsTests < InitTests
|
39
44
|
desc "methods"
|
40
45
|
|
41
|
-
let(:args1)
|
42
|
-
let(:capture_last_call_block)
|
46
|
+
let(:args1){ Factory.integer(3).times.map{ Factory.string } }
|
47
|
+
let(:capture_last_call_block){ ->(call){ @last_call = call } }
|
43
48
|
|
44
49
|
should "call to their equivalent context methods" do
|
45
50
|
assert_calls(
|
46
51
|
:assert_block,
|
47
52
|
when_calling: :returns_true,
|
48
|
-
on_value: ->
|
53
|
+
on_value: ->{},
|
49
54
|
) do |value, call|
|
50
55
|
assert_equal args1, call.args
|
51
56
|
assert_equal value, call.block
|
@@ -54,7 +59,7 @@ class Assert::ActualValue
|
|
54
59
|
assert_calls(
|
55
60
|
:assert_not_block,
|
56
61
|
when_calling: :does_not_return_true,
|
57
|
-
on_value: ->
|
62
|
+
on_value: ->{},
|
58
63
|
) do |value, call|
|
59
64
|
assert_equal args1, call.args
|
60
65
|
assert_equal value, call.block
|
@@ -63,7 +68,7 @@ class Assert::ActualValue
|
|
63
68
|
assert_calls(
|
64
69
|
:assert_raises,
|
65
70
|
when_calling: :raises,
|
66
|
-
on_value: ->
|
71
|
+
on_value: ->{},
|
67
72
|
) do |value, call|
|
68
73
|
assert_equal args1, call.args
|
69
74
|
assert_equal value, call.block
|
@@ -72,40 +77,74 @@ class Assert::ActualValue
|
|
72
77
|
assert_calls(
|
73
78
|
:assert_nothing_raised,
|
74
79
|
when_calling: :does_not_raise,
|
75
|
-
on_value: ->
|
80
|
+
on_value: ->{},
|
81
|
+
) do |value, call|
|
82
|
+
assert_equal args1, call.args
|
83
|
+
assert_equal value, call.block
|
84
|
+
end
|
85
|
+
|
86
|
+
assert_calls(
|
87
|
+
:assert_changes,
|
88
|
+
when_calling: :changes,
|
89
|
+
on_value: ->{},
|
90
|
+
) do |value, call|
|
91
|
+
assert_equal args1, call.args
|
92
|
+
assert_equal value, call.block
|
93
|
+
end
|
94
|
+
|
95
|
+
assert_calls(
|
96
|
+
:assert_not_changes,
|
97
|
+
when_calling: :does_not_change,
|
98
|
+
on_value: ->{},
|
76
99
|
) do |value, call|
|
77
100
|
assert_equal args1, call.args
|
78
101
|
assert_equal value, call.block
|
79
102
|
end
|
80
103
|
|
81
104
|
assert_calls(
|
82
|
-
:
|
105
|
+
:assert_is_a,
|
106
|
+
when_calling: [:is_a, String],
|
107
|
+
on_value: actual_value1,
|
108
|
+
) do |value, call|
|
109
|
+
assert_equal [String, value, *args1], call.args
|
110
|
+
end
|
111
|
+
|
112
|
+
assert_calls(
|
113
|
+
:assert_is_a,
|
83
114
|
when_calling: [:is_a_kind_of, String],
|
84
|
-
on_value: actual_value1
|
115
|
+
on_value: actual_value1,
|
85
116
|
) do |value, call|
|
86
117
|
assert_equal [String, value, *args1], call.args
|
87
118
|
end
|
88
119
|
|
89
120
|
assert_calls(
|
90
|
-
:
|
121
|
+
:assert_is_a,
|
91
122
|
when_calling: [:is_kind_of, String],
|
92
|
-
on_value: actual_value1
|
123
|
+
on_value: actual_value1,
|
93
124
|
) do |value, call|
|
94
125
|
assert_equal [String, value, *args1], call.args
|
95
126
|
end
|
96
127
|
|
97
128
|
assert_calls(
|
98
|
-
:
|
129
|
+
:assert_is_not_a,
|
130
|
+
when_calling: [:is_not_a, String],
|
131
|
+
on_value: actual_value1,
|
132
|
+
) do |value, call|
|
133
|
+
assert_equal [String, value, *args1], call.args
|
134
|
+
end
|
135
|
+
|
136
|
+
assert_calls(
|
137
|
+
:assert_is_not_a,
|
99
138
|
when_calling: [:is_not_a_kind_of, String],
|
100
|
-
on_value: actual_value1
|
139
|
+
on_value: actual_value1,
|
101
140
|
) do |value, call|
|
102
141
|
assert_equal [String, value, *args1], call.args
|
103
142
|
end
|
104
143
|
|
105
144
|
assert_calls(
|
106
|
-
:
|
145
|
+
:assert_is_not_a,
|
107
146
|
when_calling: [:is_not_kind_of, String],
|
108
|
-
on_value: actual_value1
|
147
|
+
on_value: actual_value1,
|
109
148
|
) do |value, call|
|
110
149
|
assert_equal [String, value, *args1], call.args
|
111
150
|
end
|
@@ -113,7 +152,7 @@ class Assert::ActualValue
|
|
113
152
|
assert_calls(
|
114
153
|
:assert_instance_of,
|
115
154
|
when_calling: [:is_an_instance_of, String],
|
116
|
-
on_value: actual_value1
|
155
|
+
on_value: actual_value1,
|
117
156
|
) do |value, call|
|
118
157
|
assert_equal [String, value, *args1], call.args
|
119
158
|
end
|
@@ -121,7 +160,7 @@ class Assert::ActualValue
|
|
121
160
|
assert_calls(
|
122
161
|
:assert_instance_of,
|
123
162
|
when_calling: [:is_instance_of, String],
|
124
|
-
on_value: actual_value1
|
163
|
+
on_value: actual_value1,
|
125
164
|
) do |value, call|
|
126
165
|
assert_equal [String, value, *args1], call.args
|
127
166
|
end
|
@@ -129,7 +168,7 @@ class Assert::ActualValue
|
|
129
168
|
assert_calls(
|
130
169
|
:assert_not_instance_of,
|
131
170
|
when_calling: [:is_not_an_instance_of, String],
|
132
|
-
on_value: actual_value1
|
171
|
+
on_value: actual_value1,
|
133
172
|
) do |value, call|
|
134
173
|
assert_equal [String, value, *args1], call.args
|
135
174
|
end
|
@@ -137,7 +176,7 @@ class Assert::ActualValue
|
|
137
176
|
assert_calls(
|
138
177
|
:assert_not_instance_of,
|
139
178
|
when_calling: [:is_not_instance_of, String],
|
140
|
-
on_value: actual_value1
|
179
|
+
on_value: actual_value1,
|
141
180
|
) do |value, call|
|
142
181
|
assert_equal [String, value, *args1], call.args
|
143
182
|
end
|
@@ -145,7 +184,7 @@ class Assert::ActualValue
|
|
145
184
|
assert_calls(
|
146
185
|
:assert_responds_to,
|
147
186
|
when_calling: [:responds_to, :method],
|
148
|
-
on_value: actual_value1
|
187
|
+
on_value: actual_value1,
|
149
188
|
) do |value, call|
|
150
189
|
assert_equal [:method, value, *args1], call.args
|
151
190
|
end
|
@@ -153,7 +192,7 @@ class Assert::ActualValue
|
|
153
192
|
assert_calls(
|
154
193
|
:assert_not_responds_to,
|
155
194
|
when_calling: [:does_not_respond_to, :method],
|
156
|
-
on_value: actual_value1
|
195
|
+
on_value: actual_value1,
|
157
196
|
) do |value, call|
|
158
197
|
assert_equal [:method, value, *args1], call.args
|
159
198
|
end
|
@@ -161,7 +200,15 @@ class Assert::ActualValue
|
|
161
200
|
assert_calls(
|
162
201
|
:assert_same,
|
163
202
|
when_calling: [:is_the_same_as, "something"],
|
164
|
-
on_value: actual_value1
|
203
|
+
on_value: actual_value1,
|
204
|
+
) do |value, call|
|
205
|
+
assert_equal ["something", value, *args1], call.args
|
206
|
+
end
|
207
|
+
|
208
|
+
assert_calls(
|
209
|
+
:assert_same,
|
210
|
+
when_calling: [:is, "something"],
|
211
|
+
on_value: actual_value1,
|
165
212
|
) do |value, call|
|
166
213
|
assert_equal ["something", value, *args1], call.args
|
167
214
|
end
|
@@ -169,7 +216,15 @@ class Assert::ActualValue
|
|
169
216
|
assert_calls(
|
170
217
|
:assert_not_same,
|
171
218
|
when_calling: [:is_not_the_same_as, "something"],
|
172
|
-
on_value: actual_value1
|
219
|
+
on_value: actual_value1,
|
220
|
+
) do |value, call|
|
221
|
+
assert_equal ["something", value, *args1], call.args
|
222
|
+
end
|
223
|
+
|
224
|
+
assert_calls(
|
225
|
+
:assert_not_same,
|
226
|
+
when_calling: [:is_not, "something"],
|
227
|
+
on_value: actual_value1,
|
173
228
|
) do |value, call|
|
174
229
|
assert_equal ["something", value, *args1], call.args
|
175
230
|
end
|
@@ -177,7 +232,7 @@ class Assert::ActualValue
|
|
177
232
|
assert_calls(
|
178
233
|
:assert_equal,
|
179
234
|
when_calling: [:equals, "something"],
|
180
|
-
on_value: actual_value1
|
235
|
+
on_value: actual_value1,
|
181
236
|
) do |value, call|
|
182
237
|
assert_equal ["something", value, *args1], call.args
|
183
238
|
end
|
@@ -185,7 +240,7 @@ class Assert::ActualValue
|
|
185
240
|
assert_calls(
|
186
241
|
:assert_equal,
|
187
242
|
when_calling: [:is_equal_to, "something"],
|
188
|
-
on_value: actual_value1
|
243
|
+
on_value: actual_value1,
|
189
244
|
) do |value, call|
|
190
245
|
assert_equal ["something", value, *args1], call.args
|
191
246
|
end
|
@@ -193,7 +248,7 @@ class Assert::ActualValue
|
|
193
248
|
assert_calls(
|
194
249
|
:assert_not_equal,
|
195
250
|
when_calling: [:does_not_equal, "something"],
|
196
|
-
on_value: actual_value1
|
251
|
+
on_value: actual_value1,
|
197
252
|
) do |value, call|
|
198
253
|
assert_equal ["something", value, *args1], call.args
|
199
254
|
end
|
@@ -201,7 +256,7 @@ class Assert::ActualValue
|
|
201
256
|
assert_calls(
|
202
257
|
:assert_not_equal,
|
203
258
|
when_calling: [:is_not_equal_to, "something"],
|
204
|
-
on_value: actual_value1
|
259
|
+
on_value: actual_value1,
|
205
260
|
) do |value, call|
|
206
261
|
assert_equal ["something", value, *args1], call.args
|
207
262
|
end
|
@@ -209,7 +264,7 @@ class Assert::ActualValue
|
|
209
264
|
assert_calls(
|
210
265
|
:assert_match,
|
211
266
|
when_calling: [:matches, "something"],
|
212
|
-
on_value: actual_value1
|
267
|
+
on_value: actual_value1,
|
213
268
|
) do |value, call|
|
214
269
|
assert_equal ["something", value, *args1], call.args
|
215
270
|
end
|
@@ -217,7 +272,7 @@ class Assert::ActualValue
|
|
217
272
|
assert_calls(
|
218
273
|
:assert_not_match,
|
219
274
|
when_calling: [:does_not_match, "something"],
|
220
|
-
on_value: actual_value1
|
275
|
+
on_value: actual_value1,
|
221
276
|
) do |value, call|
|
222
277
|
assert_equal ["something", value, *args1], call.args
|
223
278
|
end
|
@@ -225,7 +280,7 @@ class Assert::ActualValue
|
|
225
280
|
assert_calls(
|
226
281
|
:assert_empty,
|
227
282
|
when_calling: :is_empty,
|
228
|
-
on_value: actual_value1
|
283
|
+
on_value: actual_value1,
|
229
284
|
) do |value, call|
|
230
285
|
assert_equal [value, *args1], call.args
|
231
286
|
end
|
@@ -233,7 +288,7 @@ class Assert::ActualValue
|
|
233
288
|
assert_calls(
|
234
289
|
:assert_not_empty,
|
235
290
|
when_calling: :is_not_empty,
|
236
|
-
on_value: actual_value1
|
291
|
+
on_value: actual_value1,
|
237
292
|
) do |value, call|
|
238
293
|
assert_equal [value, *args1], call.args
|
239
294
|
end
|
@@ -241,7 +296,7 @@ class Assert::ActualValue
|
|
241
296
|
assert_calls(
|
242
297
|
:assert_includes,
|
243
298
|
when_calling: [:includes, "something"],
|
244
|
-
on_value: actual_value1
|
299
|
+
on_value: actual_value1,
|
245
300
|
) do |value, call|
|
246
301
|
assert_equal ["something", value, *args1], call.args
|
247
302
|
end
|
@@ -249,7 +304,7 @@ class Assert::ActualValue
|
|
249
304
|
assert_calls(
|
250
305
|
:assert_not_includes,
|
251
306
|
when_calling: [:does_not_include, "something"],
|
252
|
-
on_value: actual_value1
|
307
|
+
on_value: actual_value1,
|
253
308
|
) do |value, call|
|
254
309
|
assert_equal ["something", value, *args1], call.args
|
255
310
|
end
|
@@ -257,7 +312,7 @@ class Assert::ActualValue
|
|
257
312
|
assert_calls(
|
258
313
|
:assert_nil,
|
259
314
|
when_calling: :is_nil,
|
260
|
-
on_value: actual_value1
|
315
|
+
on_value: actual_value1,
|
261
316
|
) do |value, call|
|
262
317
|
assert_equal [value, *args1], call.args
|
263
318
|
end
|
@@ -265,7 +320,7 @@ class Assert::ActualValue
|
|
265
320
|
assert_calls(
|
266
321
|
:assert_not_nil,
|
267
322
|
when_calling: :is_not_nil,
|
268
|
-
on_value: actual_value1
|
323
|
+
on_value: actual_value1,
|
269
324
|
) do |value, call|
|
270
325
|
assert_equal [value, *args1], call.args
|
271
326
|
end
|
@@ -273,7 +328,7 @@ class Assert::ActualValue
|
|
273
328
|
assert_calls(
|
274
329
|
:assert_true,
|
275
330
|
when_calling: :is_true,
|
276
|
-
on_value: actual_value1
|
331
|
+
on_value: actual_value1,
|
277
332
|
) do |value, call|
|
278
333
|
assert_equal [value, *args1], call.args
|
279
334
|
end
|
@@ -281,7 +336,7 @@ class Assert::ActualValue
|
|
281
336
|
assert_calls(
|
282
337
|
:assert_not_true,
|
283
338
|
when_calling: :is_not_true,
|
284
|
-
on_value: actual_value1
|
339
|
+
on_value: actual_value1,
|
285
340
|
) do |value, call|
|
286
341
|
assert_equal [value, *args1], call.args
|
287
342
|
end
|
@@ -289,7 +344,7 @@ class Assert::ActualValue
|
|
289
344
|
assert_calls(
|
290
345
|
:assert_false,
|
291
346
|
when_calling: :is_false,
|
292
|
-
on_value: actual_value1
|
347
|
+
on_value: actual_value1,
|
293
348
|
) do |value, call|
|
294
349
|
assert_equal [value, *args1], call.args
|
295
350
|
end
|
@@ -297,7 +352,7 @@ class Assert::ActualValue
|
|
297
352
|
assert_calls(
|
298
353
|
:assert_not_false,
|
299
354
|
when_calling: :is_not_false,
|
300
|
-
on_value: actual_value1
|
355
|
+
on_value: actual_value1,
|
301
356
|
) do |value, call|
|
302
357
|
assert_equal [value, *args1], call.args
|
303
358
|
end
|
@@ -305,7 +360,7 @@ class Assert::ActualValue
|
|
305
360
|
assert_calls(
|
306
361
|
:assert_file_exists,
|
307
362
|
when_calling: :is_a_file,
|
308
|
-
on_value: actual_value1
|
363
|
+
on_value: actual_value1,
|
309
364
|
) do |value, call|
|
310
365
|
assert_equal [value, *args1], call.args
|
311
366
|
end
|
@@ -313,7 +368,7 @@ class Assert::ActualValue
|
|
313
368
|
assert_calls(
|
314
369
|
:assert_not_file_exists,
|
315
370
|
when_calling: :is_not_a_file,
|
316
|
-
on_value: actual_value1
|
371
|
+
on_value: actual_value1,
|
317
372
|
) do |value, call|
|
318
373
|
assert_equal [value, *args1], call.args
|
319
374
|
end
|
@@ -325,7 +380,9 @@ class Assert::ActualValue
|
|
325
380
|
@last_call = nil
|
326
381
|
Assert.stub_on_call(context1, context_method, &capture_last_call_block)
|
327
382
|
|
328
|
-
unit_class
|
383
|
+
unit_class
|
384
|
+
.new(on_value, context: context1)
|
385
|
+
.public_send(*when_calling, *args1)
|
329
386
|
yield(on_value, @last_call)
|
330
387
|
|
331
388
|
Assert.unstub(context1, context_method)
|