summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-06-01 19:38:02 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-06-01 19:38:05 +0900
commit6e7e9a80adfe69e6e6d20e01997b97a5c24cd33e (patch)
tree71e9de461d08874501bd2ac0e8f83ba7bd032dc2 /tool/lib
parentc57610dcd5e1ffcea0414d515995d950036869b0 (diff)
Expose assert_all? for ruby/csv repo
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit/assertions.rb10
-rw-r--r--tool/lib/test/unit/core_assertions.rb10
2 files changed, 10 insertions, 10 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index 14442c0029..2dfc09cfb4 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -215,16 +215,6 @@ EOT
alias assert_include assert_includes
alias assert_not_include assert_not_includes
- def assert_all?(obj, m = nil, &blk)
- failed = []
- obj.each do |*a, &b|
- unless blk.call(*a, &b)
- failed << (a.size > 1 ? a : a[0])
- end
- end
- assert(failed.empty?, message(m) {failed.pretty_inspect})
- end
-
def assert_not_all?(obj, m = nil, &blk)
failed = []
obj.each do |*a, &b|
diff --git a/tool/lib/test/unit/core_assertions.rb b/tool/lib/test/unit/core_assertions.rb
index ff78c2bdfa..63478d70b2 100644
--- a/tool/lib/test/unit/core_assertions.rb
+++ b/tool/lib/test/unit/core_assertions.rb
@@ -718,6 +718,16 @@ eom
end
end
+ def assert_all?(obj, m = nil, &blk)
+ failed = []
+ obj.each do |*a, &b|
+ unless blk.call(*a, &b)
+ failed << (a.size > 1 ? a : a[0])
+ end
+ end
+ assert(failed.empty?, message(m) {failed.pretty_inspect})
+ end
+
def assert_all_assertions(msg = nil)
all = AllFailures.new
yield all