ruby-changes:66394
From: Hiroshi <ko1@a...>
Date: Tue, 1 Jun 2021 19:38:22 +0900 (JST)
Subject: [ruby-changes:66394] 6e7e9a80ad (master): Expose assert_all? for ruby/csv repo
https://git.ruby-lang.org/ruby.git/commit/?id=6e7e9a80ad From 6e7e9a80adfe69e6e6d20e01997b97a5c24cd33e Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Tue, 1 Jun 2021 19:38:02 +0900 Subject: Expose assert_all? for ruby/csv repo --- tool/lib/test/unit/assertions.rb | 10 ---------- tool/lib/test/unit/core_assertions.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb index 14442c0..2dfc09c 100644 --- a/tool/lib/test/unit/assertions.rb +++ b/tool/lib/test/unit/assertions.rb @@ -215,16 +215,6 @@ EOT https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/assertions.rb#L215 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 ff78c2b..63478d7 100644 --- a/tool/lib/test/unit/core_assertions.rb +++ b/tool/lib/test/unit/core_assertions.rb @@ -718,6 +718,16 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/core_assertions.rb#L718 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 -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/