diff options
Diffstat (limited to 'spec/bundler/commands/install_spec.rb')
-rw-r--r-- | spec/bundler/commands/install_spec.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 610b8c189a..f189a70b10 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -364,7 +364,9 @@ RSpec.describe "bundle install with gem sources" do end it "throws a warning if a gem is added twice in Gemfile without version requirements" do - install_gemfile <<-G, :raise_on_error => false + build_repo2 + + install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" gem "rack" gem "rack" @@ -376,7 +378,9 @@ RSpec.describe "bundle install with gem sources" do end it "throws a warning if a gem is added twice in Gemfile with same versions" do - install_gemfile <<-G, :raise_on_error => false + build_repo2 + + install_gemfile <<-G source "#{file_uri_for(gem_repo2)}" gem "rack", "1.0" gem "rack", "1.0" @@ -387,6 +391,22 @@ RSpec.describe "bundle install with gem sources" do expect(err).to include("While it's not a problem now, it could cause errors if you change the version of one of them later.") end + it "throws a warning if a gem is added twice under different platforms and does not crash when using the generated lockfile" do + build_repo2 + + install_gemfile <<-G + source "#{file_uri_for(gem_repo2)}" + gem "rack", :platform => :jruby + gem "rack" + G + + bundle "install" + + expect(err).to include("Your Gemfile lists the gem rack (>= 0) more than once.") + expect(err).to include("Remove any duplicate entries and specify the gem only once.") + expect(err).to include("While it's not a problem now, it could cause errors if you change the version of one of them later.") + end + it "does not throw a warning if a gem is added once in Gemfile and also inside a gemspec as a development dependency" do build_lib "my-gem", :path => bundled_app do |s| s.add_development_dependency "my-private-gem" |