diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 20:48:28 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 20:48:28 +0000 |
commit | b5321ba446584a8a464650d62f513b1f4b48d564 (patch) | |
tree | 9b54beb44e5b8bc05f6bd5a309f99c3b09cb7049 | |
parent | be000dcc157b9fb439a255c2639af7da7bb7acb0 (diff) | |
download | ruby-b5321ba446584a8a464650d62f513b1f4b48d564.tar.gz |
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
-rw-r--r-- | test/rexml/xpath/test_base.rb | 9 |
1 files changed, 4 insertions, 5 deletions
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 </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 |