From 7e9112a4413156cce4393983ecbb98639517765a Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 13 Oct 2016 02:31:43 +0000 Subject: 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 --- test/rexml/xpath/test_text.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/rexml/xpath') 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, " has one element ancestor") nodes = @doc.get_elements('//b/ancestor::node()') assert_equal(2, nodes.size, " 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 -- cgit v1.2.3