ruby-changes:50994
From: kou <ko1@a...>
Date: Fri, 20 Apr 2018 05:48:31 +0900 (JST)
Subject: [ruby-changes:50994] kou:r63201 (trunk): rexml: Use more debug friendly assertion style
kou 2018-04-20 05:48:28 +0900 (Fri, 20 Apr 2018) New Revision: 63201 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63201 Log: rexml: Use more debug friendly assertion style test/rexml/xpath/test_base.rb: Stop to use separated assertions for checking array value. Modified files: trunk/test/rexml/xpath/test_base.rb Index: test/rexml/xpath/test_base.rb =================================================================== --- test/rexml/xpath/test_base.rb (revision 63200) +++ test/rexml/xpath/test_base.rb (revision 63201) @@ -706,8 +706,8 @@ module REXMLTests https://github.com/ruby/ruby/blob/trunk/test/rexml/xpath/test_base.rb#L706 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 https://github.com/ruby/ruby/blob/trunk/test/rexml/xpath/test_base.rb#L841 </a> 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/