summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2021-12-20 19:54:08 +0100
committergit <svn-admin@ruby-lang.org>2021-12-22 03:12:57 +0900
commitb86a7ba49252e00e19c22bbcdc821b5acc31ff92 (patch)
tree850ff2f78cf824780a87b7236a077fd1481de603 /spec
parentef973aa7aa65143a4f05d623c016d459426770d0 (diff)
[rubygems/rubygems] Fix error when gem specified twice in gemfile under different platforms
https://github.com/rubygems/rubygems/commit/83bc87ca98
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/install_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index 918dc28acb..dd4d31a1ad 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -391,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"