test-unit 3.3.3 → 3.3.4
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/doc/text/news.md +16 -0
- data/lib/test/unit.rb +129 -120
- data/lib/test/unit/assertions.rb +52 -52
- data/lib/test/unit/data.rb +2 -2
- data/lib/test/unit/notification.rb +9 -7
- data/lib/test/unit/omission.rb +34 -31
- data/lib/test/unit/pending.rb +12 -11
- data/lib/test/unit/testcase.rb +138 -123
- data/lib/test/unit/util/observable.rb +2 -2
- data/lib/test/unit/util/output.rb +5 -4
- data/lib/test/unit/version.rb +1 -1
- data/test/test-assertions.rb +10 -5
- metadata +2 -2
@@ -26,8 +26,8 @@ module Test
|
|
26
26
|
# returned, making it very easy to use the proc
|
27
27
|
# itself as the listener_key:
|
28
28
|
#
|
29
|
-
#
|
30
|
-
#
|
29
|
+
# listener = add_listener("Channel") { ... }
|
30
|
+
# remove_listener("Channel", listener)
|
31
31
|
def add_listener(channel_name, listener_key=NOTHING, &listener) # :yields: value
|
32
32
|
unless(block_given?)
|
33
33
|
raise ArgumentError.new("No callback was passed as a listener")
|
@@ -7,10 +7,11 @@ module Test
|
|
7
7
|
# error as string.
|
8
8
|
#
|
9
9
|
# Example:
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
10
|
+
#
|
11
|
+
# capture_output do
|
12
|
+
# puts("stdout")
|
13
|
+
# warn("stderr")
|
14
|
+
# end # -> ["stdout\n", "stderr\n"]
|
14
15
|
def capture_output
|
15
16
|
require 'stringio'
|
16
17
|
|
data/lib/test/unit/version.rb
CHANGED
data/test/test-assertions.rb
CHANGED
@@ -289,14 +289,19 @@ EOM
|
|
289
289
|
end
|
290
290
|
|
291
291
|
def test_same_inspected_objects
|
292
|
-
|
293
|
-
|
292
|
+
same_inspected_class = Class.new do
|
293
|
+
def inspect
|
294
|
+
"inspected"
|
295
|
+
end
|
296
|
+
end
|
297
|
+
object1 = same_inspected_class.new
|
298
|
+
object2 = same_inspected_class.new
|
294
299
|
message = <<-EOM.chomp
|
295
|
-
|
296
|
-
|
300
|
+
<inspected> expected but was
|
301
|
+
<inspected>.
|
297
302
|
EOM
|
298
303
|
check_fail(message) do
|
299
|
-
assert_equal(
|
304
|
+
assert_equal(object1, object2)
|
300
305
|
end
|
301
306
|
end
|
302
307
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: power_assert
|