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/rss/test_maker_0.9.rb | 2 ++ test/rss/test_maker_1.0.rb | 2 ++ test/rss/test_maker_2.0.rb | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'test/rss') diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb index 64d04bcd10..d07a724ab1 100644 --- a/test/rss/test_maker_0.9.rb +++ b/test/rss/test_maker_0.9.rb @@ -315,6 +315,7 @@ module RSS assert_equal(link, item.link) assert_nil(item.description) + pubDate = Time.now item_size = 5 rss = RSS::Maker.make("0.91") do |maker| @@ -325,6 +326,7 @@ module RSS _item.title = "#{title}#{i}" _item.link = "#{link}#{i}" _item.description = "#{description}#{i}" + _item.date = pubDate - i end end maker.items.do_sort = true diff --git a/test/rss/test_maker_1.0.rb b/test/rss/test_maker_1.0.rb index c8f9977e43..f3c0e50ceb 100644 --- a/test/rss/test_maker_1.0.rb +++ b/test/rss/test_maker_1.0.rb @@ -269,6 +269,7 @@ module RSS assert_equal(link, item.link) assert_nil(item.description) + pubDate = Time.now item_size = 5 rss = RSS::Maker.make("1.0") do |maker| @@ -279,6 +280,7 @@ module RSS _item.title = "#{title}#{i}" _item.link = "#{link}#{i}" _item.description = "#{description}#{i}" + _item.date = pubDate - i end end maker.items.do_sort = true diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb index 8528611e53..f6d83f0c3d 100644 --- a/test/rss/test_maker_2.0.rb +++ b/test/rss/test_maker_2.0.rb @@ -390,7 +390,7 @@ module RSS item.description = "#{description}#{i}" item.author = "#{author}#{i}" item.comments = "#{comments}#{i}" - item.date = pubDate + item.date = pubDate - i end end maker.items.do_sort = true @@ -402,8 +402,8 @@ module RSS assert_equal("#{description}#{i}", item.description) assert_equal("#{author}#{i}", item.author) assert_equal("#{comments}#{i}", item.comments) - assert_equal(pubDate, item.pubDate) - assert_equal(pubDate, item.date) + assert_equal(pubDate - i, item.pubDate) + assert_equal(pubDate - i, item.date) end rss = RSS::Maker.make("2.0") do |maker| -- cgit v1.2.1