From 71730b42434e3c2dce7e7f6488bd54fae52cae51 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 27 Sep 2015 06:35:10 +0000 Subject: test/unit/assertions.rb: all_assertions * test/lib/test/unit/assertions.rb (all_assertions): try all assertions and check if all passed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_yield.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test/ruby/test_yield.rb') diff --git a/test/ruby/test_yield.rb b/test/ruby/test_yield.rb index e7d150a08f..5c98bb8850 100644 --- a/test/ruby/test_yield.rb +++ b/test/ruby/test_yield.rb @@ -356,16 +356,12 @@ class TestRubyYieldGen < Test::Unit::TestCase end def assert_all_sentences(syntax, *args) - fails = [] syntax = Sentence.expand_syntax(syntax) - Sentence.each(syntax, *args) {|t| - begin - yield t - rescue MiniTest::Assertion => e - fails << e.message - end - } - assert(fails.empty?, proc {fails.join("\n--------\n")}) + all_assertions do |a| + Sentence.each(syntax, *args) {|t| + a.for(t) {yield t} + } + end end def test_yield -- cgit v1.2.3