test-unit 3.4.3 → 3.4.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 +7 -0
- data/lib/test/unit/assertions.rb +8 -3
- data/lib/test/unit/version.rb +1 -1
- data/test/test-assertions.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf06d094c228d2826f3ffd368b7587dad9844cb59429790157c1d00f963e527
|
4
|
+
data.tar.gz: d5d07e063a929674b11047dee03b185fdf73f926e48aa8830f2f2fa7d4c88b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d7fa4261919b37f31bd412335cc086778622f4ff63e6f645baf7c8440493e3dc2be0206bff51f5a24bb0f5f90122a61db5cbe31b2499360045092069164605
|
7
|
+
data.tar.gz: 50238b29eda4de9e4ece1c64fe3cd9a583ceeb7cb965c4e6660d39017ded8a27579723dfe206f434ff0bbd71dba9085e4af987d83d6bf76cf3ef16a475f31e4b
|
data/doc/text/news.md
CHANGED
data/lib/test/unit/assertions.rb
CHANGED
@@ -1677,7 +1677,7 @@ EOT
|
|
1677
1677
|
# @since 3.0.0
|
1678
1678
|
alias_method :refute_empty, :assert_not_empty
|
1679
1679
|
|
1680
|
-
# @overload assert_all
|
1680
|
+
# @overload assert_all(collection, message=nil, &block)
|
1681
1681
|
#
|
1682
1682
|
# Asserts that all `block.call(item)` where `item` is each
|
1683
1683
|
# item in `collection` are not false nor nil.
|
@@ -1700,8 +1700,8 @@ EOT
|
|
1700
1700
|
# @yieldreturn [Object] The checked object.
|
1701
1701
|
# @return [void]
|
1702
1702
|
#
|
1703
|
-
# @since 3.4.
|
1704
|
-
def assert_all
|
1703
|
+
# @since 3.4.4
|
1704
|
+
def assert_all(collection, message=nil)
|
1705
1705
|
_wrap_assertion do
|
1706
1706
|
failed = false
|
1707
1707
|
result = {}
|
@@ -1724,6 +1724,11 @@ EOT
|
|
1724
1724
|
end
|
1725
1725
|
end
|
1726
1726
|
|
1727
|
+
# Just for Ruby's tool/lib/test/unit compatibility.
|
1728
|
+
#
|
1729
|
+
# @since 3.4.3
|
1730
|
+
alias_method :assert_all?, :assert_all
|
1731
|
+
|
1727
1732
|
##
|
1728
1733
|
# Builds a failure message. `user_message` is added before the
|
1729
1734
|
# `template` and `arguments` replaces the '?'s positionally in
|
data/lib/test/unit/version.rb
CHANGED
data/test/test-assertions.rb
CHANGED
@@ -2235,19 +2235,19 @@ EOM
|
|
2235
2235
|
|
2236
2236
|
def test_pass
|
2237
2237
|
check_nothing_fails do
|
2238
|
-
assert_all
|
2238
|
+
assert_all([1, 2]) {|item| item > 0}
|
2239
2239
|
end
|
2240
2240
|
end
|
2241
2241
|
|
2242
2242
|
def test_pass_message
|
2243
2243
|
check_nothing_fails do
|
2244
|
-
assert_all
|
2244
|
+
assert_all([1, 2], "positive") {|item| item > 0}
|
2245
2245
|
end
|
2246
2246
|
end
|
2247
2247
|
|
2248
2248
|
def test_pass_empty
|
2249
2249
|
check_nothing_fails do
|
2250
|
-
assert_all
|
2250
|
+
assert_all([]) {|item| false}
|
2251
2251
|
end
|
2252
2252
|
end
|
2253
2253
|
|
@@ -2258,7 +2258,7 @@ message.
|
|
2258
2258
|
<{0=>true, 1=>false}>
|
2259
2259
|
EOM
|
2260
2260
|
check_fail(expected_message.chomp) do
|
2261
|
-
assert_all
|
2261
|
+
assert_all([0, 1], "message", &:zero?)
|
2262
2262
|
end
|
2263
2263
|
end
|
2264
2264
|
end
|