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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/assert.gemspec +11 -5
  4. data/bin/assert +1 -0
  5. data/lib/assert.rb +20 -6
  6. data/lib/assert/actual_value.rb +26 -8
  7. data/lib/assert/assert_runner.rb +38 -17
  8. data/lib/assert/assertions.rb +145 -41
  9. data/lib/assert/cli.rb +19 -66
  10. data/lib/assert/clirb.rb +55 -0
  11. data/lib/assert/config.rb +9 -7
  12. data/lib/assert/config_helpers.rb +57 -22
  13. data/lib/assert/context.rb +33 -49
  14. data/lib/assert/context/let_dsl.rb +10 -4
  15. data/lib/assert/context/method_missing.rb +3 -0
  16. data/lib/assert/context/setup_dsl.rb +24 -16
  17. data/lib/assert/context/subject_dsl.rb +26 -25
  18. data/lib/assert/context/suite_dsl.rb +5 -1
  19. data/lib/assert/context/test_dsl.rb +58 -19
  20. data/lib/assert/context_info.rb +2 -0
  21. data/lib/assert/default_runner.rb +2 -0
  22. data/lib/assert/default_suite.rb +27 -15
  23. data/lib/assert/default_view.rb +49 -30
  24. data/lib/assert/factory.rb +2 -0
  25. data/lib/assert/file_line.rb +8 -6
  26. data/lib/assert/macro.rb +3 -1
  27. data/lib/assert/macros/methods.rb +73 -45
  28. data/lib/assert/result.rb +117 -61
  29. data/lib/assert/runner.rb +70 -51
  30. data/lib/assert/stub.rb +44 -3
  31. data/lib/assert/suite.rb +76 -38
  32. data/lib/assert/test.rb +43 -44
  33. data/lib/assert/utils.rb +22 -11
  34. data/lib/assert/version.rb +3 -1
  35. data/lib/assert/view.rb +46 -18
  36. data/lib/assert/view_helpers.rb +102 -92
  37. data/test/helper.rb +8 -4
  38. data/test/support/factory.rb +40 -21
  39. data/test/support/inherited_stuff.rb +2 -0
  40. data/test/system/stub_tests.rb +272 -250
  41. data/test/system/test_tests.rb +89 -73
  42. data/test/unit/actual_value_tests.rb +103 -46
  43. data/test/unit/assert_tests.rb +49 -39
  44. data/test/unit/assertions/assert_block_tests.rb +14 -14
  45. data/test/unit/assertions/assert_changes_tests.rb +103 -0
  46. data/test/unit/assertions/assert_empty_tests.rb +18 -16
  47. data/test/unit/assertions/assert_equal_tests.rb +48 -32
  48. data/test/unit/assertions/assert_file_exists_tests.rb +19 -17
  49. data/test/unit/assertions/assert_includes_tests.rb +14 -14
  50. data/test/unit/assertions/assert_instance_of_tests.rb +18 -18
  51. data/test/unit/assertions/assert_is_a_tests.rb +128 -0
  52. data/test/unit/assertions/assert_match_tests.rb +14 -14
  53. data/test/unit/assertions/assert_nil_tests.rb +20 -16
  54. data/test/unit/assertions/assert_raises_tests.rb +36 -27
  55. data/test/unit/assertions/assert_respond_to_tests.rb +14 -14
  56. data/test/unit/assertions/assert_same_tests.rb +28 -32
  57. data/test/unit/assertions/assert_true_false_tests.rb +38 -32
  58. data/test/unit/assertions_tests.rb +25 -18
  59. data/test/unit/config_helpers_tests.rb +20 -9
  60. data/test/unit/config_tests.rb +16 -8
  61. data/test/unit/context/let_dsl_tests.rb +2 -0
  62. data/test/unit/context/setup_dsl_tests.rb +27 -15
  63. data/test/unit/context/subject_dsl_tests.rb +5 -4
  64. data/test/unit/context/suite_dsl_tests.rb +6 -5
  65. data/test/unit/context/test_dsl_tests.rb +43 -19
  66. data/test/unit/context_info_tests.rb +12 -3
  67. data/test/unit/context_tests.rb +166 -116
  68. data/test/unit/default_runner_tests.rb +2 -0
  69. data/test/unit/default_suite_tests.rb +17 -5
  70. data/test/unit/factory_tests.rb +5 -1
  71. data/test/unit/file_line_tests.rb +14 -12
  72. data/test/unit/macro_tests.rb +17 -10
  73. data/test/unit/result_tests.rb +72 -75
  74. data/test/unit/runner_tests.rb +38 -23
  75. data/test/unit/suite_tests.rb +48 -30
  76. data/test/unit/test_tests.rb +88 -102
  77. data/test/unit/utils_tests.rb +53 -36
  78. data/test/unit/view_helpers_tests.rb +25 -17
  79. data/test/unit/view_tests.rb +8 -5
  80. metadata +40 -9
  81. data/test/unit/assertions/assert_kind_of_tests.rb +0 -68
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "assert"
2
4
  require "assert/context"
3
5
 
@@ -8,31 +10,40 @@ require "assert/utils"
8
10
  class Assert::Context
9
11
  class UnitTests < Assert::Context
10
12
  desc "Assert::Context"
11
- subject { context1 }
13
+ subject{ unit_class }
14
+
15
+ let(:unit_class){ Assert::Context }
16
+
17
+ # DSL methods
18
+ should have_imeths :description, :desc, :describe, :subject, :suite, :let
19
+ should have_imeths :setup_once, :before_once, :startup
20
+ should have_imeths :teardown_once, :after_once, :shutdown
21
+ should have_imeths :setup, :before, :setups, :run_setups
22
+ should have_imeths :teardown, :after, :teardowns, :run_teardowns
23
+ should have_imeths :around, :arounds, :run_arounds
24
+ should have_imeths :test, :test_eventually, :test_skip
25
+ should have_imeths :should, :should_eventually, :should_skip
26
+ end
27
+
28
+ class InitTests < UnitTests
29
+ desc "when init"
30
+ subject{ context_class1.new(test1, test1.config, result_callback1) }
12
31
 
13
32
  setup do
14
33
  @callback_result = nil
15
34
  end
16
35
 
17
- let(:test1) { Factory.test }
18
- let(:context_class1) { test1.context_class }
19
- let(:test_results1) { [] }
20
- let(:result_callback1) {
21
- proc { |result| @callback_result = result; test_results1 << result }
22
- }
23
- let(:context1) { context_class1.new(test1, test1.config, result_callback1) }
24
- let(:halt_config1) { Assert::Config.new(:halt_on_fail => true) }
25
- let(:msg1) { Factory.string }
26
-
27
- # DSL methods
28
- should have_cmeths :description, :desc, :describe, :subject, :suite, :let
29
- should have_cmeths :setup_once, :before_once, :startup
30
- should have_cmeths :teardown_once, :after_once, :shutdown
31
- should have_cmeths :setup, :before, :setups, :run_setups
32
- should have_cmeths :teardown, :after, :teardowns, :run_teardowns
33
- should have_cmeths :around, :arounds, :run_arounds
34
- should have_cmeths :test, :test_eventually, :test_skip
35
- should have_cmeths :should, :should_eventually, :should_skip
36
+ let(:test1){ Factory.test }
37
+ let(:context_class1){ test1.context_class }
38
+ let(:test_results1){ [] }
39
+ let(:result_callback1) do
40
+ proc do |result|
41
+ @callback_result = result
42
+ test_results1 << result
43
+ end
44
+ end
45
+ let(:halt_config1){ Assert::Config.new(halt_on_fail: true) }
46
+ let(:msg1){ Factory.string }
36
47
 
37
48
  should have_imeths :assert, :assert_not, :refute, :assert_that
38
49
  should have_imeths :pass, :ignore, :fail, :flunk, :skip
@@ -40,7 +51,8 @@ class Assert::Context
40
51
 
41
52
  should "collect context info" do
42
53
  test = @__assert_running_test__
43
- assert_that(test.context_info.file).matches(/test\/unit\/context_tests.rb$/)
54
+ assert_that(test.context_info.file)
55
+ .matches(%r{test/unit/context_tests.rb$})
44
56
  assert_that(test.context_info.klass).equals(self.class)
45
57
  end
46
58
 
@@ -52,7 +64,9 @@ class Assert::Context
52
64
  with_backtrace(caller) do
53
65
  assert_that(result.with_bt_set?).is_true
54
66
 
55
- exp = Assert::Result::Backtrace.to_s(exp_with_bt+[(result.backtrace.filtered.first)])
67
+ exp =
68
+ Assert::Result::Backtrace.to_s(exp_with_bt +
69
+ [(result.backtrace.filtered.first)])
56
70
  assert_that(result.trace).equals(exp)
57
71
  assert_that(result.src_line).equals(exp_with_bt.first)
58
72
  end
@@ -63,24 +77,29 @@ class Assert::Context
63
77
  assert_that(result.with_bt_set?).is_false
64
78
 
65
79
  assert_that(result.trace).equals(result.src_line)
66
- assert_that(result.src_line).equals(result.backtrace.filtered.first.to_s)
80
+ assert_that(result.src_line)
81
+ .equals(result.backtrace.filtered.first.to_s)
67
82
  end
68
83
  end
69
84
  end
70
85
 
71
- class SkipTests < UnitTests
86
+ class SkipTests < InitTests
72
87
  desc "skip method"
73
- subject { @result }
74
88
 
75
89
  setup do
76
- begin; context1.skip(msg1); rescue StandardError => @exception; end
90
+ @exception =
91
+ begin
92
+ subject.skip(msg1)
93
+ rescue => ex
94
+ ex
95
+ end
77
96
  @result = Factory.skip_result(@exception)
78
97
  end
79
98
 
80
99
  should "raise a test skipped exception and set its message" do
81
100
  assert_that(@exception).is_kind_of(Assert::Result::TestSkipped)
82
101
  assert_that(@exception.message).equals(msg1)
83
- assert_that(subject.message).equals(msg1)
102
+ assert_that(@result.message).equals(msg1)
84
103
  end
85
104
 
86
105
  should "not call the result callback" do
@@ -91,23 +110,27 @@ class Assert::Context
91
110
  assert_that(@exception.backtrace.size).does_not_equal(1)
92
111
 
93
112
  called_from = Factory.string
94
- begin; context1.skip(msg1, called_from); rescue StandardError => exception; end
113
+ exception =
114
+ begin
115
+ subject.skip(msg1, called_from)
116
+ rescue => ex
117
+ ex
118
+ end
95
119
  assert_that(exception.backtrace.size).equals(1)
96
120
  assert_that(exception.backtrace.first).equals(called_from)
97
121
  end
98
122
  end
99
123
 
100
- class IgnoreTests < UnitTests
124
+ class IgnoreTests < InitTests
101
125
  desc "ignore method"
102
- subject { @result }
103
126
 
104
127
  setup do
105
- @result = context1.ignore(msg1)
128
+ @result = subject.ignore(msg1)
106
129
  end
107
130
 
108
131
  should "create an ignore result and set its message" do
109
- assert_that(subject).is_kind_of(Assert::Result::Ignore)
110
- assert_that(subject.message).equals(msg1)
132
+ assert_that(@result).is_kind_of(Assert::Result::Ignore)
133
+ assert_that(@result.message).equals(msg1)
111
134
  end
112
135
 
113
136
  should "call the result callback" do
@@ -115,17 +138,16 @@ class Assert::Context
115
138
  end
116
139
  end
117
140
 
118
- class PassTests < UnitTests
141
+ class PassTests < InitTests
119
142
  desc "pass method"
120
- subject { @result }
121
143
 
122
144
  setup do
123
- @result = context1.pass(msg1)
145
+ @result = subject.pass(msg1)
124
146
  end
125
147
 
126
148
  should "create a pass result and set its message" do
127
- assert_that(subject).is_kind_of(Assert::Result::Pass)
128
- assert_that(subject.message).equals(msg1)
149
+ assert_that(@result).is_kind_of(Assert::Result::Pass)
150
+ assert_that(@result.message).equals(msg1)
129
151
  end
130
152
 
131
153
  should "call the result callback" do
@@ -133,17 +155,16 @@ class Assert::Context
133
155
  end
134
156
  end
135
157
 
136
- class FlunkTests < UnitTests
158
+ class FlunkTests < InitTests
137
159
  desc "flunk method"
138
- subject { @result }
139
160
 
140
161
  setup do
141
- @result = context1.flunk(msg1)
162
+ @result = subject.flunk(msg1)
142
163
  end
143
164
 
144
165
  should "create a fail result and set its message" do
145
- assert_that(subject).is_kind_of(Assert::Result::Fail)
146
- assert_that(subject.message).equals(msg1)
166
+ assert_that(@result).is_kind_of(Assert::Result::Fail)
167
+ assert_that(@result.message).equals(msg1)
147
168
  end
148
169
 
149
170
  should "call the result callback" do
@@ -151,22 +172,21 @@ class Assert::Context
151
172
  end
152
173
  end
153
174
 
154
- class FailTests < UnitTests
175
+ class FailTests < InitTests
155
176
  desc "fail method"
156
- subject { @result }
157
177
 
158
178
  setup do
159
- @result = context1.fail
179
+ @result = subject.fail
160
180
  end
161
181
 
162
182
  should "create a fail result and set its backtrace" do
163
- assert_that(subject).is_kind_of(Assert::Result::Fail)
164
- assert_that(subject.trace).equals(subject.backtrace.filtered.first.to_s)
165
- assert_that(subject.backtrace).is_kind_of(Array)
183
+ assert_that(@result).is_kind_of(Assert::Result::Fail)
184
+ assert_that(@result.trace).equals(@result.backtrace.filtered.first.to_s)
185
+ assert_that(@result.backtrace).is_kind_of(Array)
166
186
  end
167
187
 
168
188
  should "set any given result message" do
169
- result = context1.fail(msg1)
189
+ result = subject.fail(msg1)
170
190
  assert_that(result.message).equals(msg1)
171
191
  end
172
192
 
@@ -175,18 +195,22 @@ class Assert::Context
175
195
  end
176
196
  end
177
197
 
178
- class HaltOnFailTests < UnitTests
198
+ class HaltOnFailTests < InitTests
179
199
  desc "failing when halting on fails"
180
- subject { @result }
181
-
182
- let(:context1) { context_class1.new(test1, halt_config1, result_callback1) }
200
+ subject{ context_class1.new(test1, halt_config1, result_callback1) }
183
201
 
184
202
  should "raise an exception with the failure's message" do
185
- begin; context1.fail(msg1); rescue StandardError => err; end
186
- assert_that(err).is_kind_of(Assert::Result::TestFailure)
187
- assert_that(err.message).equals(msg1)
188
-
189
- result = Assert::Result::Fail.for_test(Factory.test("something"), err)
203
+ exception =
204
+ begin
205
+ subject.fail(msg1)
206
+ rescue => ex
207
+ ex
208
+ end
209
+ assert_that(exception).is_kind_of(Assert::Result::TestFailure)
210
+ assert_that(exception.message).equals(msg1)
211
+
212
+ result =
213
+ Assert::Result::Fail.for_test(Factory.test("something"), exception)
190
214
  assert_that(result.message).equals(msg1)
191
215
  end
192
216
 
@@ -195,10 +219,10 @@ class Assert::Context
195
219
  end
196
220
  end
197
221
 
198
- class AssertTests < UnitTests
222
+ class AssertTests < InitTests
199
223
  desc "assert method"
200
224
 
201
- let(:what_failed) { Factory.string }
225
+ let(:what_failed){ Factory.string }
202
226
 
203
227
  should "return a pass result given a `true` assertion" do
204
228
  result = subject.assert(true, msg1){ what_failed }
@@ -212,7 +236,8 @@ class Assert::Context
212
236
  end
213
237
 
214
238
  should "pp the assertion value in the fail message by default" do
215
- exp_def_what = "Failed assert: assertion was `#{Assert::U.show(false, test1.config)}`."
239
+ exp_def_what =
240
+ "Failed assert: assertion was `#{Assert::U.show(false, test1.config)}`."
216
241
  result = subject.assert(false, msg1)
217
242
 
218
243
  assert_that(result.message).equals([msg1, exp_def_what].join("\n"))
@@ -232,7 +257,7 @@ class Assert::Context
232
257
  end
233
258
  end
234
259
 
235
- class AssertNotTests < UnitTests
260
+ class AssertNotTests < InitTests
236
261
  desc "assert_not method"
237
262
 
238
263
  should "return a pass result given a `false` assertion" do
@@ -247,7 +272,9 @@ class Assert::Context
247
272
  end
248
273
 
249
274
  should "pp the assertion value in the fail message by default" do
250
- exp_def_what = "Failed assert_not: assertion was `#{Assert::U.show(true, test1.config)}`."
275
+ exp_def_what =
276
+ "Failed assert_not: "\
277
+ "assertion was `#{Assert::U.show(true, test1.config)}`."
251
278
  result = subject.assert_not(true, msg1)
252
279
 
253
280
  assert_that(result.message).equals([msg1, exp_def_what].join("\n"))
@@ -262,53 +289,61 @@ class Assert::Context
262
289
  end
263
290
  end
264
291
 
265
- class AssertThatTests < UnitTests
292
+ class AssertThatTests < InitTests
266
293
  desc "`assert_that` method"
267
294
 
268
295
  setup do
269
- Assert.stub_tap_on_call(Assert::ActualValue, :new) { |_, call|
296
+ Assert.stub_tap_on_call(Assert::ActualValue, :new) do |_, call|
270
297
  @actual_value_new_call = call
271
- }
298
+ end
272
299
  end
273
300
 
274
- let(:actual_value) { Factory.string }
301
+ let(:actual_value){ Factory.string }
275
302
 
276
303
  should "build an Assert::ActualValue" do
277
304
  assert_instance_of Assert::ActualValue, subject.assert_that(actual_value)
278
305
  assert_equal [actual_value], @actual_value_new_call.pargs
279
- assert_equal({ context: context1 }, @actual_value_new_call.kargs)
306
+ assert_equal({ context: subject }, @actual_value_new_call.kargs)
280
307
  end
281
308
  end
282
309
 
283
- class SubjectTests < UnitTests
310
+ class SubjectTests < InitTests
284
311
  desc "subject method"
285
- subject { @subject }
312
+ subject{ context_class1.new(test1, test1.config, proc{ |result| }) }
286
313
 
287
314
  setup do
288
315
  expected = expected1
289
- context_class1.subject { @something = expected }
290
- @subject = context1.subject
316
+ context_class1.subject{ @something = expected }
317
+ @subject = subject.subject
291
318
  end
292
319
 
293
- let(:context_class1) { Factory.modes_off_context_class }
294
- let(:context1) { context_class1.new(test1, test1.config, proc{ |result| }) }
295
- let(:expected1) { Factory.string }
320
+ let(:context_class1){ Factory.modes_off_context_class }
321
+ let(:expected1){ Factory.string }
296
322
 
297
323
  should "instance evaluate the block set with the class setup method" do
298
- assert_that(subject).equals(expected1)
324
+ assert_that(@subject).equals(expected1)
299
325
  end
300
326
  end
301
327
 
302
- class PendingTests < UnitTests
328
+ class PendingTests < InitTests
303
329
  desc "`pending` method"
304
330
 
305
- let(:block2) { proc { fail; pass; } }
306
- let(:block1) { block = block2; proc { pending(&block) } } # test nesting
331
+ let(:block2) do
332
+ proc do
333
+ fail # rubocop:disable Style/SignalException
334
+ pass # rubocop:disable Lint/UnreachableCode
335
+ end
336
+ end
337
+ # test nesting
338
+ let(:block1) do
339
+ block = block2
340
+ proc{ pending(&block) }
341
+ end
307
342
 
308
343
  should "make fails skips and make passes fails" do
309
- context1.fail "not affected"
310
- context1.pass
311
- context1.pending(&block1)
344
+ subject.fail "not affected"
345
+ subject.pass
346
+ subject.pending(&block1)
312
347
 
313
348
  assert_that(test_results1.size).equals(4)
314
349
  norm_fail, norm_pass, pending_fail, pending_pass = test_results1
@@ -326,31 +361,42 @@ class Assert::Context
326
361
 
327
362
  class PendingWithHaltOnFailTests < PendingTests
328
363
  desc "when halting on fails"
329
- subject { @result }
330
-
331
- let(:context1) { context_class1.new(test1, halt_config1, result_callback1) }
364
+ subject{ context_class1.new(test1, halt_config1, result_callback1) }
332
365
 
333
366
  should "make fails skips and stop the test" do
334
- begin; context1.pending(&block1); rescue StandardError => err; end
335
- assert_that(err).is_kind_of(Assert::Result::TestSkipped)
336
- assert_that(err.message).includes("Pending fail")
337
-
338
- assert_that(test_results1.size).equals(0) # it halted before the pending pass
367
+ exception =
368
+ begin
369
+ subject.pending(&block1)
370
+ rescue => ex
371
+ ex
372
+ end
373
+ assert_that(exception).is_kind_of(Assert::Result::TestSkipped)
374
+ assert_that(exception.message).includes("Pending fail")
375
+
376
+ # it halted before the pending pass
377
+ assert_that(test_results1.size).equals(0)
339
378
  end
340
379
  end
341
380
 
342
- class WithBacktraceTests < UnitTests
381
+ class WithBacktraceTests < InitTests
343
382
  desc "`with_backtrace` method"
344
383
 
345
- let(:from_bt1) { ["called_from_here", Factory.string] }
346
- let(:from_block1) { proc { ignore; fail; pass; skip "todo"; } }
384
+ let(:from_bt1){ ["called_from_here", Factory.string] }
385
+ let(:from_block1) do
386
+ proc do
387
+ ignore
388
+ fail # rubocop:disable Style/SignalException
389
+ pass # rubocop:disable Lint/UnreachableCode
390
+ skip "todo"
391
+ end
392
+ end
347
393
 
348
394
  should "alter non-error block results' bt with given bt's first line" do
349
- context1.fail "not affected"
395
+ subject.fail "not affected"
350
396
  begin
351
- context1.with_backtrace(from_bt1, &from_block1)
352
- rescue Assert::Result::TestSkipped => e
353
- test_results1 << Assert::Result::Skip.for_test(test1, e)
397
+ subject.with_backtrace(from_bt1, &from_block1)
398
+ rescue Assert::Result::TestSkipped => ex
399
+ test_results1 << Assert::Result::Skip.for_test(test1, ex)
354
400
  end
355
401
 
356
402
  assert_that(test_results1.size).equals(5)
@@ -366,24 +412,32 @@ class Assert::Context
366
412
  end
367
413
  end
368
414
 
369
- class WithNestedBacktraceTests < UnitTests
415
+ class WithNestedBacktraceTests < InitTests
370
416
  desc "`with_backtrace` method nested"
371
417
 
372
- let(:from_bt1) { ["called_from_here 1", Factory.string] }
373
- let(:from_bt2) { ["called_from_here 2", Factory.string] }
374
- let(:from_block2) { proc { ignore; fail; pass; skip "todo"; } }
375
- let(:from_block1) {
418
+ let(:from_bt1){ ["called_from_here 1", Factory.string] }
419
+ let(:from_bt2){ ["called_from_here 2", Factory.string] }
420
+ let(:from_block2) do
421
+ proc do
422
+ ignore
423
+ fail # rubocop:disable Style/SignalException
424
+ pass # rubocop:disable Lint/UnreachableCode
425
+ skip "todo"
426
+ end
427
+ end
428
+ let(:from_block1) do
376
429
  from_bt = from_bt2
377
430
  from_block = from_block2
378
- proc { with_backtrace(from_bt, &from_block) }
379
- }
431
+ proc{ with_backtrace(from_bt, &from_block) }
432
+ end
380
433
 
381
- should "alter non-error block results' bt with nested wbt accrued first lines" do
382
- context1.fail "not affected"
434
+ should "alter non-error block results' bt with nested wbt accrued "\
435
+ "first lines" do
436
+ subject.fail "not affected"
383
437
  begin
384
- context1.with_backtrace(from_bt1, &from_block1)
385
- rescue Assert::Result::TestSkipped => e
386
- test_results1 << Assert::Result::Skip.for_test(test1, e)
438
+ subject.with_backtrace(from_bt1, &from_block1)
439
+ rescue Assert::Result::TestSkipped => ex
440
+ test_results1 << Assert::Result::Skip.for_test(test1, ex)
387
441
  end
388
442
 
389
443
  assert_that(test_results1.size).equals(5)
@@ -399,15 +453,11 @@ class Assert::Context
399
453
  end
400
454
  end
401
455
 
402
- class InspectTests < UnitTests
456
+ class InspectTests < InitTests
403
457
  desc "inspect method"
404
- subject { inspect1 }
405
-
406
- let(:inspect1) { context1.inspect }
407
458
 
408
459
  should "just show the name of the class" do
409
- exp = "#<#{context1.class}>"
410
- assert_that(subject).equals(exp)
460
+ assert_that(subject.inspect).equals("#<#{subject.class}>")
411
461
  end
412
462
  end
413
463
  end