diff options
-rw-r--r-- | spec/plugins/list_spec.rb | 14 |
1 files 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 |