mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Expose assert_all? for ruby/csv repo
This commit is contained in:
parent
c57610dcd5
commit
6e7e9a80ad
2 changed files with 10 additions and 10 deletions
|
@ -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|
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue