minitest 2.2.1 → 2.2.2
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/History.txt +7 -0
- data/lib/minitest/unit.rb +7 -6
- data/test/test_minitest_unit.rb +7 -7
- metadata +3 -3
- metadata.gz.sig +1 -3
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/lib/minitest/unit.rb
CHANGED
@@ -115,10 +115,11 @@ module MiniTest
|
|
115
115
|
|
116
116
|
Tempfile.open("expect") do |a|
|
117
117
|
a.puts expect
|
118
|
-
a.
|
118
|
+
a.flush
|
119
|
+
|
119
120
|
Tempfile.open("butwas") do |b|
|
120
121
|
b.puts butwas
|
121
|
-
b.
|
122
|
+
b.flush
|
122
123
|
|
123
124
|
result = `#{MiniTest::Assertions.diff} #{a.path} #{b.path}`
|
124
125
|
result.sub!(/^\-\-\- .+/, "--- expected")
|
@@ -210,7 +211,7 @@ module MiniTest
|
|
210
211
|
# See also: MiniTest::Assertions.diff
|
211
212
|
|
212
213
|
def assert_equal exp, act, msg = nil
|
213
|
-
msg = message(msg) { diff exp, act }
|
214
|
+
msg = message(msg, "") { diff exp, act }
|
214
215
|
assert(exp == act, msg)
|
215
216
|
end
|
216
217
|
|
@@ -458,10 +459,10 @@ module MiniTest
|
|
458
459
|
##
|
459
460
|
# Returns a proc that will output +msg+ along with the default message.
|
460
461
|
|
461
|
-
def message msg = nil, &default
|
462
|
+
def message msg = nil, ending = ".", &default
|
462
463
|
proc {
|
463
464
|
custom_message = "#{msg}.\n" unless msg.nil? or msg.to_s.empty?
|
464
|
-
"#{custom_message}#{default.call}
|
465
|
+
"#{custom_message}#{default.call}#{ending}"
|
465
466
|
}
|
466
467
|
end
|
467
468
|
|
@@ -613,7 +614,7 @@ module MiniTest
|
|
613
614
|
end
|
614
615
|
|
615
616
|
class Unit
|
616
|
-
VERSION = "2.2.
|
617
|
+
VERSION = "2.2.2" # :nodoc:
|
617
618
|
|
618
619
|
attr_accessor :report, :failures, :errors, :skips # :nodoc:
|
619
620
|
attr_accessor :test_count, :assertion_count # :nodoc:
|
data/test/test_minitest_unit.rb
CHANGED
@@ -533,7 +533,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
533
533
|
@@ -1 +1 @@
|
534
534
|
-#<#<Class:0xXXXXXX>:0xXXXXXX @name=\"a\">
|
535
535
|
+#<#<Class:0xXXXXXX>:0xXXXXXX @name=\"b\">
|
536
|
-
|
536
|
+
".gsub(/^ +/, "")
|
537
537
|
|
538
538
|
util_assert_triggered msg do
|
539
539
|
@tc.assert_equal o1, o2
|
@@ -546,7 +546,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
546
546
|
|
547
547
|
msg = "No visible difference.
|
548
548
|
You should look at your implementation of Object#==.
|
549
|
-
#<Object:0xXXXXXX
|
549
|
+
#<Object:0xXXXXXX>".gsub(/^ +/, "")
|
550
550
|
|
551
551
|
util_assert_triggered msg do
|
552
552
|
@tc.assert_equal o1, o2
|
@@ -559,7 +559,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
559
559
|
@@ -1 +1 @@
|
560
560
|
-\"hahahahahahahahahahahahahahahahahahahaha\"
|
561
561
|
+\"blahblahblahblahblahblahblahblahblahblah\"
|
562
|
-
|
562
|
+
".gsub(/^ +/, "")
|
563
563
|
|
564
564
|
util_assert_triggered msg do
|
565
565
|
o1 = "haha" * 10
|
@@ -572,7 +572,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
572
572
|
def test_assert_equal_different_long_invisible
|
573
573
|
msg = "No visible difference.
|
574
574
|
You should look at your implementation of String#==.
|
575
|
-
\"blahblahblahblahblahblahblahblahblahblah\"
|
575
|
+
\"blahblahblahblahblahblahblahblahblahblah\"".gsub(/^ +/, "")
|
576
576
|
|
577
577
|
util_assert_triggered msg do
|
578
578
|
o1 = "blah" * 10
|
@@ -591,7 +591,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
591
591
|
@@ -1 +1 @@
|
592
592
|
-\"hahahahahahahahahahahahahahahahahahahaha\"
|
593
593
|
+\"blahblahblahblahblahblahblahblahblahblah\"
|
594
|
-
|
594
|
+
".gsub(/^ +/, "")
|
595
595
|
|
596
596
|
util_assert_triggered msg do
|
597
597
|
o1 = "haha" * 10
|
@@ -613,7 +613,7 @@ class TestMiniTestUnitTestCase < MiniTest::Unit::TestCase
|
|
613
613
|
end
|
614
614
|
|
615
615
|
def test_assert_equal_different_short_multiline
|
616
|
-
msg = "--- expected\n+++ actual\n@@ -1,2 +1,2 @@\n \"a\n-b\"\n+c\"\n
|
616
|
+
msg = "--- expected\n+++ actual\n@@ -1,2 +1,2 @@\n \"a\n-b\"\n+c\"\n"
|
617
617
|
util_assert_triggered msg do
|
618
618
|
@tc.assert_equal "a\nb", "a\nc"
|
619
619
|
end
|
@@ -1283,7 +1283,7 @@ FILE:LINE:in `test_assert_raises_triggered_subclass'
|
|
1283
1283
|
end
|
1284
1284
|
|
1285
1285
|
def util_msg exp, act, msg = nil
|
1286
|
-
s = "Expected: #{exp.inspect}\n Actual: #{act.inspect}
|
1286
|
+
s = "Expected: #{exp.inspect}\n Actual: #{act.inspect}"
|
1287
1287
|
s = "#{msg}.\n#{s}" if msg
|
1288
1288
|
s
|
1289
1289
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED