summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-21 20:53:36 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-09-18 18:26:32 +0900
commit0c6529bac2c38c536567e443b7da851144e84be8 (patch)
tree4619f5294629d6dcc2b5b5a426ba69ec56b42064 /spec/bundler
parent6f16ededdd5eed8bab9e4f4cb70032a151fbc405 (diff)
[bundler/bundler] Revert "Add all platforms to lockfile by default"
This reverts commit 3dc509e645abb497e4dc92a7c42be471ff87db0b. https://github.com/bundler/bundler/commit/b5766564fb
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/install/gemfile/platform_spec.rb26
-rw-r--r--spec/bundler/runtime/require_spec.rb2
2 files changed, 5 insertions, 23 deletions
diff --git a/spec/bundler/install/gemfile/platform_spec.rb b/spec/bundler/install/gemfile/platform_spec.rb
index 4cbf238416..c096531398 100644
--- a/spec/bundler/install/gemfile/platform_spec.rb
+++ b/spec/bundler/install/gemfile/platform_spec.rb
@@ -372,7 +372,7 @@ RSpec.describe "bundle install with platform conditionals" do
expect(out).not_to match(/Could not find gem 'some_gem/)
end
- it "resolves all platforms by default and without warning messages" do
+ it "prints a helpful warning when a dependency is unused on any platform" do
simulate_platform "ruby"
simulate_ruby_engine "ruby"
@@ -384,27 +384,9 @@ RSpec.describe "bundle install with platform conditionals" do
bundle! "install"
- expect(err).to be_empty
-
- lockfile_should_be <<-L
- GEM
- remote: #{file_uri_for(gem_repo1)}/
- specs:
- rack (1.0.0)
-
- PLATFORMS
- java
- ruby
- x64-mingw32
- x86-mingw32
- x86-mswin32
-
- DEPENDENCIES
- rack
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
+ expect(err).to include <<-O.strip
+The dependency #{Gem::Dependency.new("rack", ">= 0")} will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
+ O
end
context "when disable_platform_warnings is true" do
diff --git a/spec/bundler/runtime/require_spec.rb b/spec/bundler/runtime/require_spec.rb
index 7874a86c32..42d0c2db77 100644
--- a/spec/bundler/runtime/require_spec.rb
+++ b/spec/bundler/runtime/require_spec.rb
@@ -425,7 +425,7 @@ RSpec.describe "Bundler.require with platform specific dependencies" do
source "#{file_uri_for(gem_repo1)}"
platforms :#{not_local_tag} do
- gem "platform_specific", :require => "omgomg"
+ gem "fail", :require => "omgomg"
end
gem "rack", "1.0.0"