minitest 2.9.0 → 2.9.1
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.
- data.tar.gz.sig +0 -0
- data/.autotest +1 -1
- data/History.txt +13 -0
- data/lib/minitest/spec.rb +10 -7
- data/lib/minitest/unit.rb +4 -4
- data/test/test_minitest_spec.rb +216 -41
- data/test/test_minitest_unit.rb +20 -12
- metadata +4 -4
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/.autotest
CHANGED
@@ -5,7 +5,7 @@ require 'autotest/restart'
|
|
5
5
|
Autotest.add_hook :initialize do |at|
|
6
6
|
at.testlib = 'minitest/unit'
|
7
7
|
|
8
|
-
at.extra_class_map["
|
8
|
+
at.extra_class_map["MiniTest::Spec"] = "test/test_minitest_spec.rb"
|
9
9
|
at.extra_class_map["TestMiniTestTestCase"] = "test/test_minitest_unit.rb"
|
10
10
|
at.extra_class_map["TestMiniTestUnit"] = "test/test_minitest_unit.rb"
|
11
11
|
at.add_exception 'coverage.info'
|
data/History.txt
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
=== 2.9.1 / 2011-12-13
|
2
|
+
|
3
|
+
* 4 minor enhancements:
|
4
|
+
|
5
|
+
* Added a ton of tests on spec error message output.
|
6
|
+
* Cleaned up consistency of msg handling on unary expectations.
|
7
|
+
* Improved error messages on assert/refute_in_delta.
|
8
|
+
* infect_an_assertion no longer checks arity and better handles args.
|
9
|
+
|
10
|
+
* 1 bug fix:
|
11
|
+
|
12
|
+
* Fixed error message on specs when 2+ args and custom message provided. (chastell)
|
13
|
+
|
1
14
|
=== 2.9.0 / 2011-12-07
|
2
15
|
|
3
16
|
* 4 minor enhancements:
|
data/lib/minitest/spec.rb
CHANGED
@@ -7,11 +7,14 @@ class Module # :nodoc:
|
|
7
7
|
# warn "%-22p -> %p %p" % [meth, new_name, dont_flip]
|
8
8
|
self.class_eval <<-EOM
|
9
9
|
def #{new_name} *args
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
case
|
11
|
+
when Proc === self then
|
12
|
+
MiniTest::Spec.current.#{meth}(*args, &self)
|
13
|
+
when #{!!dont_flip} then
|
14
|
+
MiniTest::Spec.current.#{meth}(self, *args)
|
15
|
+
else
|
16
|
+
MiniTest::Spec.current.#{meth}(args.first, self, *args[1..-1])
|
17
|
+
end
|
15
18
|
end
|
16
19
|
EOM
|
17
20
|
end
|
@@ -328,7 +331,7 @@ module MiniTest::Expectations
|
|
328
331
|
#
|
329
332
|
# :method: must_be_nil
|
330
333
|
|
331
|
-
infect_an_assertion :assert_nil, :must_be_nil
|
334
|
+
infect_an_assertion :assert_nil, :must_be_nil, :unary
|
332
335
|
|
333
336
|
##
|
334
337
|
# See MiniTest::Assertions#assert_operator
|
@@ -489,7 +492,7 @@ module MiniTest::Expectations
|
|
489
492
|
#
|
490
493
|
# :method: wont_be_nil
|
491
494
|
|
492
|
-
infect_an_assertion :refute_nil, :wont_be_nil
|
495
|
+
infect_an_assertion :refute_nil, :wont_be_nil, :unary
|
493
496
|
|
494
497
|
##
|
495
498
|
# See MiniTest::Assertions#refute_operator
|
data/lib/minitest/unit.rb
CHANGED
@@ -224,7 +224,7 @@ module MiniTest
|
|
224
224
|
|
225
225
|
def assert_in_delta exp, act, delta = 0.001, msg = nil
|
226
226
|
n = (exp - act).abs
|
227
|
-
msg = message(msg) { "Expected
|
227
|
+
msg = message(msg) { "Expected |#{exp} - #{act}| (#{n}) to be < #{delta}"}
|
228
228
|
assert delta >= n, msg
|
229
229
|
end
|
230
230
|
|
@@ -333,7 +333,7 @@ module MiniTest
|
|
333
333
|
# Fails unless the block raises one of +exp+
|
334
334
|
|
335
335
|
def assert_raises *exp
|
336
|
-
msg = "#{exp.pop}
|
336
|
+
msg = "#{exp.pop}.\n" if String === exp.last
|
337
337
|
|
338
338
|
should_raise = false
|
339
339
|
begin
|
@@ -526,7 +526,7 @@ module MiniTest
|
|
526
526
|
def refute_in_delta exp, act, delta = 0.001, msg = nil
|
527
527
|
n = (exp - act).abs
|
528
528
|
msg = message(msg) {
|
529
|
-
"Expected
|
529
|
+
"Expected |#{exp} - #{act}| (#{n}) to not be < #{delta}"
|
530
530
|
}
|
531
531
|
refute delta > n, msg
|
532
532
|
end
|
@@ -643,7 +643,7 @@ module MiniTest
|
|
643
643
|
end
|
644
644
|
|
645
645
|
class Unit # :nodoc:
|
646
|
-
VERSION = "2.9.
|
646
|
+
VERSION = "2.9.1" # :nodoc:
|
647
647
|
|
648
648
|
attr_accessor :report, :failures, :errors, :skips # :nodoc:
|
649
649
|
attr_accessor :test_count, :assertion_count # :nodoc:
|
data/test/test_minitest_spec.rb
CHANGED
@@ -7,6 +7,19 @@ class ExampleA; end
|
|
7
7
|
class ExampleB < ExampleA; end
|
8
8
|
|
9
9
|
describe MiniTest::Spec do
|
10
|
+
def assert_triggered expected = "blah", klass = MiniTest::Assertion
|
11
|
+
@assertion_count += 2
|
12
|
+
|
13
|
+
e = assert_raises(klass) do
|
14
|
+
yield
|
15
|
+
end
|
16
|
+
|
17
|
+
msg = e.message.sub(/(---Backtrace---).*/m, '\1')
|
18
|
+
msg.gsub!(/\(oid=[-0-9]+\)/, '(oid=N)')
|
19
|
+
|
20
|
+
assert_equal expected, msg
|
21
|
+
end
|
22
|
+
|
10
23
|
before do
|
11
24
|
@assertion_count = 4
|
12
25
|
end
|
@@ -56,47 +69,107 @@ describe MiniTest::Spec do
|
|
56
69
|
|
57
70
|
it "needs to verify equality" do
|
58
71
|
(6 * 7).must_equal(42).must_equal true
|
59
|
-
|
72
|
+
|
73
|
+
assert_triggered "Expected: 42\n Actual: 54" do
|
74
|
+
(6 * 9).must_equal 42
|
75
|
+
end
|
76
|
+
|
77
|
+
assert_triggered "msg.\nExpected: 42\n Actual: 54" do
|
78
|
+
(6 * 9).must_equal 42, "msg"
|
79
|
+
end
|
60
80
|
end
|
61
81
|
|
62
82
|
it "needs to verify floats within a delta" do
|
83
|
+
@assertion_count += 1 # extra test
|
84
|
+
|
63
85
|
(6.0 * 7).must_be_close_to(42.0).must_equal true
|
64
|
-
|
86
|
+
|
87
|
+
assert_triggered 'Expected |0.0 - 0.01| (0.01) to be < 0.001.' do
|
88
|
+
(1.0 / 100).must_be_close_to 0.0
|
89
|
+
end
|
90
|
+
|
91
|
+
assert_triggered 'Expected |0.0 - 0.001| (0.001) to be < 1.0e-06.' do
|
92
|
+
(1.0 / 1000).must_be_close_to 0.0, 0.000001
|
93
|
+
end
|
94
|
+
|
95
|
+
assert_triggered "msg.\nExpected |0.0 - 0.001| (0.001) to be < 1.0e-06." do
|
96
|
+
(1.0 / 1000).must_be_close_to 0.0, 0.000001, "msg"
|
97
|
+
end
|
65
98
|
end
|
66
99
|
|
67
100
|
it "needs to verify types of objects" do
|
68
101
|
(6 * 7).must_be_instance_of(Fixnum).must_equal true
|
69
|
-
|
102
|
+
|
103
|
+
exp = "Expected 42 to be an instance of String, not Fixnum."
|
104
|
+
|
105
|
+
assert_triggered exp do
|
106
|
+
(6 * 7).must_be_instance_of String
|
107
|
+
end
|
108
|
+
|
109
|
+
assert_triggered "msg.\n#{exp}" do
|
110
|
+
(6 * 7).must_be_instance_of String, "msg"
|
111
|
+
end
|
70
112
|
end
|
71
113
|
|
72
114
|
it "needs to verify kinds of objects" do
|
73
|
-
@assertion_count
|
115
|
+
@assertion_count += 2 # extra test
|
74
116
|
|
75
117
|
(6 * 7).must_be_kind_of(Fixnum).must_equal true
|
76
118
|
(6 * 7).must_be_kind_of(Numeric).must_equal true
|
77
|
-
|
119
|
+
|
120
|
+
assert_triggered "Expected 42 to be a kind of String, not Fixnum." do
|
121
|
+
(6 * 7).must_be_kind_of String
|
122
|
+
end
|
123
|
+
|
124
|
+
assert_triggered "msg.\nExpected 42 to be a kind of String, not Fixnum." do
|
125
|
+
(6 * 7).must_be_kind_of String, "msg"
|
126
|
+
end
|
78
127
|
end
|
79
128
|
|
80
129
|
it "needs to verify regexp matches" do
|
81
|
-
@assertion_count
|
130
|
+
@assertion_count += 3 # must_match is 2 assertions
|
82
131
|
|
83
132
|
"blah".must_match(/\w+/).must_equal true
|
84
|
-
|
133
|
+
|
134
|
+
assert_triggered "Expected /\\d+/ to match \"blah\"." do
|
135
|
+
"blah".must_match(/\d+/)
|
136
|
+
end
|
137
|
+
|
138
|
+
assert_triggered "msg.\nExpected /\\d+/ to match \"blah\"." do
|
139
|
+
"blah".must_match(/\d+/, "msg")
|
140
|
+
end
|
85
141
|
end
|
86
142
|
|
87
143
|
it "needs to verify nil" do
|
88
144
|
nil.must_be_nil.must_equal true
|
89
|
-
|
145
|
+
|
146
|
+
assert_triggered "Expected 42 to be nil." do
|
147
|
+
42.must_be_nil
|
148
|
+
end
|
149
|
+
|
150
|
+
assert_triggered "msg.\nExpected 42 to be nil." do
|
151
|
+
42.must_be_nil "msg"
|
152
|
+
end
|
90
153
|
end
|
91
154
|
|
92
155
|
it "needs to verify using any binary operator" do
|
156
|
+
@assertion_count -= 1 # no msg
|
157
|
+
|
93
158
|
41.must_be(:<, 42).must_equal true
|
94
|
-
|
159
|
+
|
160
|
+
assert_triggered "Expected 42 to be < 41." do
|
161
|
+
42.must_be(:<, 41)
|
162
|
+
end
|
95
163
|
end
|
96
164
|
|
97
165
|
it "needs to verify using any predicate" do
|
166
|
+
@assertion_count -= 1 # no msg
|
167
|
+
|
98
168
|
"".must_be(:empty?).must_equal true
|
99
|
-
|
169
|
+
|
170
|
+
assert_triggered "Expected \"blah\" to be empty?." do
|
171
|
+
"blah".must_be :empty?
|
172
|
+
end
|
100
173
|
end
|
101
174
|
|
102
175
|
it "needs to catch an expected exception" do
|
@@ -107,105 +180,207 @@ describe MiniTest::Spec do
|
|
107
180
|
end
|
108
181
|
|
109
182
|
it "needs to catch an unexpected exception" do
|
110
|
-
@assertion_count
|
183
|
+
@assertion_count -= 2 # no positive
|
184
|
+
|
185
|
+
msg = <<-EOM.gsub(/^ {6}/, '').chomp
|
186
|
+
[RuntimeError] exception expected, not
|
187
|
+
Class: <MiniTest::Assertion>
|
188
|
+
Message: <\"MiniTest::Assertion\">
|
189
|
+
---Backtrace---
|
190
|
+
EOM
|
111
191
|
|
112
|
-
|
113
|
-
proc { raise MiniTest::Assertion }.must_raise
|
114
|
-
|
192
|
+
assert_triggered msg do
|
193
|
+
proc { raise MiniTest::Assertion }.must_raise RuntimeError
|
194
|
+
end
|
195
|
+
|
196
|
+
assert_triggered "msg.\n#{msg}" do
|
197
|
+
proc { raise MiniTest::Assertion }.must_raise RuntimeError, "msg"
|
198
|
+
end
|
115
199
|
end
|
116
200
|
|
117
|
-
it "needs raise if an expected exception is not raised" do
|
118
|
-
@assertion_count
|
201
|
+
it "needs to raise if an expected exception is not raised" do
|
202
|
+
@assertion_count -= 2 # no positive test
|
203
|
+
|
204
|
+
assert_triggered "RuntimeError expected but nothing was raised." do
|
205
|
+
proc { 42 }.must_raise RuntimeError
|
206
|
+
end
|
119
207
|
|
120
|
-
|
208
|
+
assert_triggered "msg.\nRuntimeError expected but nothing was raised." do
|
209
|
+
proc { 42 }.must_raise RuntimeError, "msg"
|
210
|
+
end
|
121
211
|
end
|
122
212
|
|
123
213
|
it "needs to be able to catch a MiniTest::Assertion exception" do
|
124
|
-
@assertion_count =
|
214
|
+
@assertion_count = 1
|
125
215
|
|
126
|
-
|
216
|
+
assert_triggered "Expected 1 to not be equal to 1." do
|
217
|
+
1.wont_equal 1
|
218
|
+
end
|
127
219
|
end
|
128
220
|
|
129
221
|
it "needs to verify using respond_to" do
|
130
222
|
42.must_respond_to(:+).must_equal true
|
131
|
-
|
223
|
+
|
224
|
+
assert_triggered "Expected 42 (Fixnum) to respond to #clear." do
|
225
|
+
42.must_respond_to :clear
|
226
|
+
end
|
227
|
+
|
228
|
+
assert_triggered "msg.\nExpected 42 (Fixnum) to respond to #clear." do
|
229
|
+
42.must_respond_to :clear, "msg"
|
230
|
+
end
|
132
231
|
end
|
133
232
|
|
134
233
|
it "needs to verify identity" do
|
135
234
|
1.must_be_same_as(1).must_equal true
|
136
|
-
|
235
|
+
|
236
|
+
assert_triggered "Expected 1 (oid=N) to be the same as 2 (oid=N)." do
|
237
|
+
1.must_be_same_as 2
|
238
|
+
end
|
239
|
+
|
240
|
+
assert_triggered "msg.\nExpected 1 (oid=N) to be the same as 2 (oid=N)." do
|
241
|
+
1.must_be_same_as 2, "msg"
|
242
|
+
end
|
137
243
|
end
|
138
244
|
|
139
245
|
it "needs to verify throw" do
|
140
|
-
@assertion_count
|
246
|
+
@assertion_count += 2 # 2 extra tests
|
141
247
|
|
142
248
|
proc { throw :blah }.must_throw(:blah).must_equal true
|
143
|
-
|
144
|
-
|
249
|
+
|
250
|
+
assert_triggered "Expected :blah to have been thrown." do
|
251
|
+
proc { }.must_throw :blah
|
252
|
+
end
|
253
|
+
|
254
|
+
assert_triggered "Expected :blah to have been thrown, not :xxx." do
|
255
|
+
proc { throw :xxx }.must_throw :blah
|
256
|
+
end
|
257
|
+
|
258
|
+
assert_triggered "msg.\nExpected :blah to have been thrown." do
|
259
|
+
proc { }.must_throw :blah, "msg"
|
260
|
+
end
|
261
|
+
|
262
|
+
assert_triggered "msg.\nExpected :blah to have been thrown, not :xxx." do
|
263
|
+
proc { throw :xxx }.must_throw :blah, "msg"
|
264
|
+
end
|
145
265
|
end
|
146
266
|
|
147
267
|
it "needs to verify inequality" do
|
148
268
|
42.wont_equal(6 * 9).must_equal false
|
149
|
-
|
269
|
+
|
270
|
+
assert_triggered "Expected 1 to not be equal to 1." do
|
271
|
+
1.wont_equal 1
|
272
|
+
end
|
273
|
+
|
274
|
+
assert_triggered "msg.\nExpected 1 to not be equal to 1." do
|
275
|
+
1.wont_equal 1, "msg"
|
276
|
+
end
|
150
277
|
end
|
151
278
|
|
152
279
|
it "needs to verify mismatch" do
|
153
|
-
@assertion_count
|
280
|
+
@assertion_count += 3 # match is 2
|
281
|
+
|
154
282
|
"blah".wont_match(/\d+/).must_equal false
|
155
|
-
|
283
|
+
|
284
|
+
assert_triggered "Expected /\\w+/ to not match \"blah\"." do
|
285
|
+
"blah".wont_match(/\w+/)
|
286
|
+
end
|
287
|
+
|
288
|
+
assert_triggered "msg.\nExpected /\\w+/ to not match \"blah\"." do
|
289
|
+
"blah".wont_match(/\w+/, "msg")
|
290
|
+
end
|
156
291
|
end
|
157
292
|
|
158
293
|
it "needs to verify using any (negative) predicate" do
|
294
|
+
@assertion_count -= 1 # doesn't take a message
|
295
|
+
|
159
296
|
"blah".wont_be(:empty?).must_equal false
|
160
|
-
|
297
|
+
|
298
|
+
assert_triggered "Expected \"\" to not be empty?." do
|
299
|
+
"".wont_be :empty?
|
300
|
+
end
|
161
301
|
end
|
162
302
|
|
163
303
|
it "needs to verify non-nil" do
|
164
304
|
42.wont_be_nil.must_equal false
|
165
|
-
|
305
|
+
|
306
|
+
assert_triggered "Expected nil to not be nil." do
|
307
|
+
nil.wont_be_nil
|
308
|
+
end
|
309
|
+
|
310
|
+
assert_triggered "msg.\nExpected nil to not be nil." do
|
311
|
+
nil.wont_be_nil "msg"
|
312
|
+
end
|
166
313
|
end
|
167
314
|
|
168
315
|
it "needs to verify non-identity" do
|
169
316
|
1.wont_be_same_as(2).must_equal false
|
170
|
-
|
317
|
+
|
318
|
+
assert_triggered "Expected 1 (oid=N) to not be the same as 1 (oid=N)." do
|
319
|
+
1.wont_be_same_as 1
|
320
|
+
end
|
321
|
+
|
322
|
+
assert_triggered "msg.\nExpected 1 (oid=N) to not be the same as 1 (oid=N)." do
|
323
|
+
1.wont_be_same_as 1, "msg"
|
324
|
+
end
|
171
325
|
end
|
172
326
|
|
173
327
|
it "needs to verify output in stdout" do
|
328
|
+
@assertion_count -= 1 # no msg
|
329
|
+
|
174
330
|
proc { print "blah" }.must_output("blah").must_equal true
|
175
331
|
|
176
|
-
|
332
|
+
assert_triggered "In stdout.\nExpected: \"blah\"\n Actual: \"xxx\"" do
|
177
333
|
proc { print "xxx" }.must_output("blah")
|
178
|
-
|
334
|
+
end
|
179
335
|
end
|
180
336
|
|
181
337
|
it "needs to verify output in stderr" do
|
338
|
+
@assertion_count -= 1 # no msg
|
339
|
+
|
182
340
|
proc { $stderr.print "blah" }.must_output(nil, "blah").must_equal true
|
183
341
|
|
184
|
-
|
342
|
+
assert_triggered "In stderr.\nExpected: \"blah\"\n Actual: \"xxx\"" do
|
185
343
|
proc { $stderr.print "xxx" }.must_output(nil, "blah")
|
186
|
-
|
344
|
+
end
|
187
345
|
end
|
188
346
|
|
189
347
|
it "needs to ensure silence" do
|
190
|
-
@assertion_count
|
348
|
+
@assertion_count -= 1 # no msg
|
349
|
+
@assertion_count += 2 # assert_output is 2 assertions
|
191
350
|
|
192
351
|
proc { }.must_be_silent.must_equal true
|
193
352
|
|
194
|
-
|
353
|
+
assert_triggered "In stdout.\nExpected: \"\"\n Actual: \"xxx\"" do
|
195
354
|
proc { print "xxx" }.must_be_silent
|
196
|
-
|
355
|
+
end
|
197
356
|
end
|
198
357
|
|
199
358
|
it "needs to be sensible about must_include order" do
|
200
|
-
@assertion_count
|
359
|
+
@assertion_count += 3 # must_include is 2 assertions
|
360
|
+
|
201
361
|
[1, 2, 3].must_include(2).must_equal true
|
202
|
-
|
362
|
+
|
363
|
+
assert_triggered "Expected [1, 2, 3] to include 5." do
|
364
|
+
[1, 2, 3].must_include 5
|
365
|
+
end
|
366
|
+
|
367
|
+
assert_triggered "msg.\nExpected [1, 2, 3] to include 5." do
|
368
|
+
[1, 2, 3].must_include 5, "msg"
|
369
|
+
end
|
203
370
|
end
|
204
371
|
|
205
372
|
it "needs to be sensible about wont_include order" do
|
206
|
-
@assertion_count
|
373
|
+
@assertion_count += 3 # wont_include is 2 assertions
|
374
|
+
|
207
375
|
[1, 2, 3].wont_include(5).must_equal false
|
208
|
-
|
376
|
+
|
377
|
+
assert_triggered "Expected [1, 2, 3] to not include 2." do
|
378
|
+
[1, 2, 3].wont_include 2
|
379
|
+
end
|
380
|
+
|
381
|
+
assert_triggered "msg.\nExpected [1, 2, 3] to not include 2." do
|
382
|
+
[1, 2, 3].wont_include 2, "msg"
|
383
|
+
end
|
209
384
|
end
|
210
385
|
end
|
211
386
|
|
data/test/test_minitest_unit.rb
CHANGED
@@ -769,7 +769,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
769
769
|
end
|
770
770
|
|
771
771
|
def test_assert_in_delta_triggered
|
772
|
-
util_assert_triggered 'Expected 0.0 - 0.001 (0.001) to be < 1.0e-06.' do
|
772
|
+
util_assert_triggered 'Expected |0.0 - 0.001| (0.001) to be < 1.0e-06.' do
|
773
773
|
@tc.assert_in_delta 0.0, 1.0 / 1000, 0.000001
|
774
774
|
end
|
775
775
|
end
|
@@ -789,7 +789,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
789
789
|
end
|
790
790
|
|
791
791
|
def test_assert_in_epsilon_triggered
|
792
|
-
util_assert_triggered 'Expected 10000 - 9990 (10) to be < 9.99.' do
|
792
|
+
util_assert_triggered 'Expected |10000 - 9990| (10) to be < 9.99.' do
|
793
793
|
@tc.assert_in_epsilon 10000, 9990
|
794
794
|
end
|
795
795
|
end
|
@@ -1004,13 +1004,15 @@ FILE:LINE:in `test_assert_raises_triggered_different'
|
|
1004
1004
|
end
|
1005
1005
|
end
|
1006
1006
|
|
1007
|
-
expected =
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1007
|
+
expected = <<-EOM.gsub(/^ {6}/, '').chomp
|
1008
|
+
XXX.
|
1009
|
+
[RuntimeError] exception expected, not
|
1010
|
+
Class: <SyntaxError>
|
1011
|
+
Message: <\"icky\">
|
1012
|
+
---Backtrace---
|
1013
|
+
FILE:LINE:in `test_assert_raises_triggered_different_msg'
|
1014
|
+
---------------
|
1015
|
+
EOM
|
1014
1016
|
|
1015
1017
|
actual = e.message.gsub(/^.+:\d+/, 'FILE:LINE')
|
1016
1018
|
actual.gsub!(/block \(\d+ levels\) in /, '') if RUBY_VERSION >= '1.9.0'
|
@@ -1037,7 +1039,7 @@ FILE:LINE:in `test_assert_raises_triggered_different_msg'
|
|
1037
1039
|
end
|
1038
1040
|
end
|
1039
1041
|
|
1040
|
-
expected = "XXX
|
1042
|
+
expected = "XXX.\nMiniTest::Assertion expected but nothing was raised."
|
1041
1043
|
|
1042
1044
|
assert_equal expected, e.message
|
1043
1045
|
end
|
@@ -1217,6 +1219,12 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
|
|
1217
1219
|
end
|
1218
1220
|
end
|
1219
1221
|
|
1222
|
+
def test_expectation_with_a_message
|
1223
|
+
util_assert_triggered "Expected: 2\n Actual: 1" do
|
1224
|
+
1.must_equal 2, ''
|
1225
|
+
end
|
1226
|
+
end
|
1227
|
+
|
1220
1228
|
def test_flunk
|
1221
1229
|
util_assert_triggered 'Epic Fail!' do
|
1222
1230
|
@tc.flunk
|
@@ -1282,7 +1290,7 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
|
|
1282
1290
|
end
|
1283
1291
|
|
1284
1292
|
def test_refute_in_delta_triggered
|
1285
|
-
util_assert_triggered 'Expected 0.0 - 0.001 (0.001) to not be < 0.1.' do
|
1293
|
+
util_assert_triggered 'Expected |0.0 - 0.001| (0.001) to not be < 0.1.' do
|
1286
1294
|
@tc.refute_in_delta 0.0, 1.0 / 1000, 0.1
|
1287
1295
|
end
|
1288
1296
|
end
|
@@ -1292,7 +1300,7 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
|
|
1292
1300
|
end
|
1293
1301
|
|
1294
1302
|
def test_refute_in_epsilon_triggered
|
1295
|
-
util_assert_triggered 'Expected 10000 - 9991 (9) to not be < 10.0.' do
|
1303
|
+
util_assert_triggered 'Expected |10000 - 9991| (9) to not be < 10.0.' do
|
1296
1304
|
@tc.refute_in_epsilon 10000, 9991
|
1297
1305
|
fail
|
1298
1306
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 41
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 2.9.
|
9
|
+
- 1
|
10
|
+
version: 2.9.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2011-12-
|
39
|
+
date: 2011-12-14 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hoe
|
metadata.gz.sig
CHANGED
Binary file
|