You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bundler.ui.warn"A gemspec development dependency (#{dep.name}, #{current.requirement}) is being overridden by a Gemfile dependency (#{dep.name}, #{dep.requirement}).\n" \
114
-
"This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n" \
Bundler.ui.warn"A gemspec development dependency (#{gemspec_dep.name}, #{gemspec_dep.requirement}) is being overridden by a Gemfile dependency (#{gemfile_dep.name}, #{gemfile_dep.requirement}).\n" \
117
+
"This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement\n"
115
118
end
119
+
120
+
returnifdep.gemspec_dev_dep?
116
121
else
117
122
update_prompt=""
118
123
@@ -130,8 +135,8 @@ def gem(name, *args)
130
135
"You specified: #{current.name} (#{current.requirement}) and #{dep.name} (#{dep.requirement})" \
it"warns when a Gemfile dependency is overriding a gemspec development dependency, with different requirements"do
464
+
build_lib"my-gem",path: bundled_appdo |s|
465
+
s.add_development_dependency"rails",">= 5"
466
+
end
467
+
468
+
build_repo4do
469
+
build_gem"rails","7.0.8"
470
+
end
471
+
472
+
gemfile<<~G
473
+
source "#{file_uri_for(gem_repo4)}"
474
+
475
+
gem "rails", "~> 7.0.8"
476
+
477
+
gemspec
478
+
G
479
+
480
+
bundle:install
481
+
482
+
expect(err).toinclude("A gemspec development dependency (rails, >= 5) is being overridden by a Gemfile dependency (rails, ~> 7.0.8).")
483
+
expect(err).toinclude("This behaviour may change in the future. Please remove either of them, or make sure they both have the same requirement")
484
+
485
+
# This is not the best behavior I believe, it would be better if both
486
+
# requirements are considered if they are compatible, and a version
487
+
# satisfying both is chosen. But not sure about changing it right now, so
488
+
# I went with a warning for the time being.
489
+
expect(the_bundle).toinclude_gems("rails 7.0.8")
490
+
end
491
+
463
492
it"does not warn if a gem is added once in Gemfile and also inside a gemspec as a development dependency, with same requirements, and different sources"do
0 commit comments