From 055cf917d17b6abae19ac6fb2ab0ea70acb87a19 Mon Sep 17 00:00:00 2001 From: meganemura Date: Wed, 25 Oct 2017 23:02:41 +0900 Subject: Fix failing spec for `bundle plugin list` Bundler::Plugin::Index#installed_plugins is keys of Hash, and Hash is not ordered in prior to Ruby 1.9. So, foo and bar plugins are not always listed in that order. --- spec/plugins/list_spec.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/spec/plugins/list_spec.rb b/spec/plugins/list_spec.rb index 7dc9d10c4b..9b09f74498 100644 --- a/spec/plugins/list_spec.rb +++ b/spec/plugins/list_spec.rb @@ -53,8 +53,18 @@ RSpec.describe "bundler plugin list" do plugin_should_be_installed("foo", "bar") bundle "plugin list" - expected_output = "foo\n-----\n shout\n\nbar\n-----\n scream" - expect(out).to include(expected_output) + if RUBY_VERSION < "1.9" + # Bundler::Plugin::Index#installed_plugins is keys of Hash, + # and Hash is not ordered in prior to Ruby 1.9. + # So, foo and bar plugins are not always listed in that order. + expected_output1 = "foo\n-----\n shout" + expect(out).to include(expected_output1) + expected_output2 = "bar\n-----\n scream" + expect(out).to include(expected_output2) + else + expected_output = "foo\n-----\n shout\n\nbar\n-----\n scream" + expect(out).to include(expected_output) + end end end end -- cgit v1.2.1