From b5321ba446584a8a464650d62f513b1f4b48d564 Mon Sep 17 00:00:00 2001 From: kou Date: Thu, 19 Apr 2018 20:48:28 +0000 Subject: rexml: Use more debug friendly assertion style test/rexml/xpath/test_base.rb: Stop to use separated assertions for checking array value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rexml/xpath/test_base.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/rexml/xpath') diff --git a/test/rexml/xpath/test_base.rb b/test/rexml/xpath/test_base.rb index d9351e829e..044f0a33f0 100644 --- a/test/rexml/xpath/test_base.rb +++ b/test/rexml/xpath/test_base.rb @@ -706,8 +706,8 @@ module REXMLTests XML d = REXML::Document.new( source ) r = REXML::XPath.match( d, %q{/a/*/*[1]} ) - assert_equal( 1, r.size ) - r.each { |el| assert_equal( '1', el.attribute('id').value ) } + assert_equal(["1"], + r.collect {|element| element.attribute("id").value}) end def test_descendant_or_self_ordering @@ -841,9 +841,8 @@ module REXMLTests EOL d = REXML::Document.new( string ) - c1 = XPath.match( d, '/a/*/*[1]' ) - assert_equal( 1, c1.length ) - assert_equal( 'c1', c1[0].name ) + cs = XPath.match( d, '/a/*/*[1]' ) + assert_equal(["c1"], cs.collect(&:name)) end def test_sum -- cgit v1.2.3