summaryrefslogtreecommitdiff
path: root/test/rexml/xpath
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-13 02:31:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-13 02:31:43 +0000
commit7e9112a4413156cce4393983ecbb98639517765a (patch)
treef1aad3112e10277ebc1c8cf8f8ca11893329deb2 /test/rexml/xpath
parent43112104dffdcee69628d60dd78d761e8ea650ae (diff)
Fix tests depending on sort stability
* test/rexml/xpath/test_text.rb (test_ancestors): Array#sort may not be stable. [ruby-core:76088] [Bug #12509] * test/rss/test_maker_{0.9,1.0,2.0}.rb (test_items): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/xpath')
-rw-r--r--test/rexml/xpath/test_text.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/rexml/xpath/test_text.rb b/test/rexml/xpath/test_text.rb
index cea3b05731..7222388e1b 100644
--- a/test/rexml/xpath/test_text.rb
+++ b/test/rexml/xpath/test_text.rb
@@ -69,7 +69,9 @@ module REXMLTests
assert_equal(1, nodes.size, "<b> has one element ancestor")
nodes = @doc.get_elements('//b/ancestor::node()')
assert_equal(2, nodes.size, "<b> has two node ancestors")
- assert_kind_of REXML::Document, nodes[1]
+ nodes.sort_by!(&:name)
+ assert_kind_of REXML::Document, nodes[0]
+ assert_kind_of REXML::Element, nodes[1]
end
end
end