diff options
author | Colby Swandale <colby@taplaboratories.com> | 2017-08-02 22:43:51 +1000 |
---|---|---|
committer | Colby Swandale <colby@taplaboratories.com> | 2017-08-20 12:05:27 +1000 |
commit | 1451bdf8b1038fd64dee8b1c13174a5d543474b3 (patch) | |
tree | 2796493c25024a5b2e905cd3ae02f80c38444ade | |
parent | 778a11b2b78b900a0803da871a280af87556a3fc (diff) | |
download | bundler-seg-deprecations-hard-error-in-2.tar.gz |
fix tests/functionality breaking with new deprecation errorseg-deprecations-hard-error-in-2
-rw-r--r-- | lib/bundler/cli/open.rb | 2 | ||||
-rw-r--r-- | spec/commands/inject_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/install_spec.rb | 6 | ||||
-rw-r--r-- | spec/commands/show_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/binstubs_spec.rb | 8 | ||||
-rw-r--r-- | spec/install/bundler_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/platform_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile_spec.rb | 4 | ||||
-rw-r--r-- | spec/lock/git_spec.rb | 2 | ||||
-rw-r--r-- | spec/other/bundle_ruby_spec.rb | 2 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 14 | ||||
-rw-r--r-- | spec/plugins/source/example_spec.rb | 2 | ||||
-rw-r--r-- | spec/quality_spec.rb | 1 | ||||
-rw-r--r-- | spec/realworld/parallel_spec.rb | 8 | ||||
-rw-r--r-- | spec/runtime/with_clean_env_spec.rb | 14 |
15 files changed, 35 insertions, 38 deletions
diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb index 380dbcb258..fb18b0aacc 100644 --- a/lib/bundler/cli/open.rb +++ b/lib/bundler/cli/open.rb @@ -18,7 +18,7 @@ module Bundler path = spec.full_gem_path Dir.chdir(path) do command = Shellwords.split(editor) + [path] - Bundler.with_clean_env do + Bundler.with_original_env do system(*command) end || Bundler.ui.info("Could not run '#{command.join(" ")}'") end diff --git a/spec/commands/inject_spec.rb b/spec/commands/inject_spec.rb index 80d22ee286..6c1994b59d 100644 --- a/spec/commands/inject_spec.rb +++ b/spec/commands/inject_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle inject" do +RSpec.describe "bundle inject", :bundler => "< 2" do before :each do gemfile <<-G source "file://#{gem_repo1}" diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index 46ec7105a0..7370c27c25 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -389,10 +389,10 @@ RSpec.describe "bundle install with gem sources" do context "and using an unsupported Ruby version" do it "prints an error" do install_gemfile <<-G - ::RUBY_VERSION = '1.8.7' - ruby '~> 2.1' + ::RUBY_VERSION = '2.0.1' + ruby '~> 2.2' G - expect(out).to include("Your Ruby version is 1.8.7, but your Gemfile specified ~> 2.1") + expect(out).to include("Your Ruby version is 2.0.1, but your Gemfile specified ~> 2.2") end end diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 9b2648bf75..d91ac275d1 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle show" do +RSpec.describe "bundle show", :bundler => "< 2" do context "with a standard Gemfile" do before :each do install_gemfile <<-G diff --git a/spec/install/binstubs_spec.rb b/spec/install/binstubs_spec.rb index 9f361035e0..23eb691ab8 100644 --- a/spec/install/binstubs_spec.rb +++ b/spec/install/binstubs_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle install" do +RSpec.describe "bundle install", :bundler => "< 2" do describe "when system_bindir is set" do # On OS X, Gem.bindir defaults to /usr/bin, so system_bindir is useful if # you want to avoid sudo installs for system gems with OS X's default ruby @@ -35,12 +35,6 @@ RSpec.describe "bundle install" do G end - it "prints a deprecation notice" do - bundle "config major_deprecations true" - gembin("rackup") - expect(out).to include("Bundler is using a binstub that was created for a different gem (rack).") - end - it "loads the correct spec's executable" do gembin("rackup") expect(out).to eq("1.2") diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb index 3c5ae0a84f..08b7e2b673 100644 --- a/spec/install/bundler_spec.rb +++ b/spec/install/bundler_spec.rb @@ -125,7 +125,7 @@ RSpec.describe "bundle install" do expect(last_command.bundler_err).to include(nice_error) end - it "can install dependencies with newer bundler version with system gems" do + it "can install dependencies with newer bundler version with system gems", :ruby => "> 2" do bundle! "config path.system true" install_gemfile! <<-G source "file://#{gem_repo2}" @@ -138,7 +138,7 @@ RSpec.describe "bundle install" do expect(out).to include("The Gemfile's dependencies are satisfied") end - it "can install dependencies with newer bundler version with a local path" do + it "can install dependencies with newer bundler version with a local path", :ruby => "> 2" do bundle! "config path .bundle" install_gemfile! <<-G source "file://#{gem_repo2}" diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb index d14847daa9..d7d4e0a53c 100644 --- a/spec/install/gemfile/platform_spec.rb +++ b/spec/install/gemfile/platform_spec.rb @@ -199,7 +199,7 @@ RSpec.describe "bundle install with platform conditionals" do end G - bundle :show + bundle :list expect(exitstatus).to eq(0) if exitstatus end diff --git a/spec/install/gemfile_spec.rb b/spec/install/gemfile_spec.rb index d1b1f1e6b8..945d9f485d 100644 --- a/spec/install/gemfile_spec.rb +++ b/spec/install/gemfile_spec.rb @@ -36,7 +36,7 @@ RSpec.describe "bundle install" do end it "uses the gemfile to install" do bundle "install" - bundle "show" + bundle "list" expect(out).to include("rack (1.0.0)") end @@ -44,7 +44,7 @@ RSpec.describe "bundle install" do bundled_app("subdir").mkpath Dir.chdir(bundled_app("subdir")) do bundle "install" - bundle "show" + bundle "list" expect(out).to include("rack (1.0.0)") end diff --git a/spec/lock/git_spec.rb b/spec/lock/git_spec.rb index 4179a0218a..14b80483ee 100644 --- a/spec/lock/git_spec.rb +++ b/spec/lock/git_spec.rb @@ -29,6 +29,6 @@ RSpec.describe "bundle lock with git gems" do run <<-RUBY puts Bundler.rubygems.find_name('foo').first.full_gem_path RUBY - expect(out).to eq(bundle("show foo")) + expect(out).to eq(bundle("info foo --path")) end end diff --git a/spec/other/bundle_ruby_spec.rb b/spec/other/bundle_ruby_spec.rb index e65bbc5e42..6cc33f60ac 100644 --- a/spec/other/bundle_ruby_spec.rb +++ b/spec/other/bundle_ruby_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle_ruby" do +RSpec.describe "bundle_ruby", :bundler => "< 2" do context "without patchlevel" do it "returns the ruby version" do gemfile <<-G diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index 63831c89b6..fea5daf5ac 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -586,7 +586,7 @@ G end end - context "bundle show" do + context "bundle info" do before do install_gemfile <<-G source "file://#{gem_repo1}" @@ -602,7 +602,7 @@ G #{ruby_version_correct} G - bundle "show rails" + bundle "info rails --path" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end @@ -615,12 +615,12 @@ G #{ruby_version_correct_engineless} G - bundle "show rails" + bundle "info rails --path" expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end end - it "fails if ruby version doesn't match" do + it "fails if ruby version doesn't match", :bundler => "< 2" do gemfile <<-G source "file://#{gem_repo1}" gem "rails" @@ -632,7 +632,7 @@ G should_be_ruby_version_incorrect end - it "fails if engine doesn't match" do + it "fails if engine doesn't match", :bundler => "< 2" do gemfile <<-G source "file://#{gem_repo1}" gem "rails" @@ -644,7 +644,7 @@ G should_be_engine_incorrect end - it "fails if engine version doesn't match" do + it "fails if engine version doesn't match", :bundler => "< 2" do simulate_ruby_engine "jruby" do gemfile <<-G source "file://#{gem_repo1}" @@ -658,7 +658,7 @@ G end end - it "fails when patchlevel doesn't match" do + it "fails when patchlevel doesn't match", :bundler => "< 2" do gemfile <<-G source "file://#{gem_repo1}" gem "rack" diff --git a/spec/plugins/source/example_spec.rb b/spec/plugins/source/example_spec.rb index 368c75702d..aa3163ad40 100644 --- a/spec/plugins/source/example_spec.rb +++ b/spec/plugins/source/example_spec.rb @@ -118,7 +118,7 @@ RSpec.describe "real source plugins" do run <<-RUBY puts Bundler.rubygems.find_name('a-path-gem').first.full_gem_path RUBY - expect(out).to eq(bundle("show a-path-gem")) + expect(out).to eq(bundle("info a-path-gem --path")) end it "installs the gem executables" do diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index dcc518dce4..d4f3ddaf9b 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -229,6 +229,7 @@ RSpec.describe "The library itself" do Dir.chdir(root) do exclusions = %w[ lib/bundler/capistrano.rb + lib/bundler/deployment.rb lib/bundler/gem_tasks.rb lib/bundler/vlad.rb lib/bundler/templates/gems.rb diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb index e8d9771b09..ed4430c68b 100644 --- a/spec/realworld/parallel_spec.rb +++ b/spec/realworld/parallel_spec.rb @@ -17,10 +17,10 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do expect(out).to include("is not threadsafe") end - bundle "show activesupport" + bundle "info activesupport --path" expect(out).to match(/activesupport/) - bundle "show faker" + bundle "info faker --path" expect(out).to match(/faker/) end @@ -46,10 +46,10 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do expect(out).to include("is not threadsafe") end - bundle "show activesupport" + bundle "info activesupport --path" expect(out).to match(/activesupport-3\.2\.\d+/) - bundle "show faker" + bundle "info faker --path" expect(out).to match(/faker/) end diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb index 5cd9f264c2..78eebaff79 100644 --- a/spec/runtime/with_clean_env_spec.rb +++ b/spec/runtime/with_clean_env_spec.rb @@ -3,8 +3,9 @@ RSpec.describe "Bundler.with_env helpers" do describe "Bundler.original_env" do before do + bundle "config path vendor/bundle" gemfile "" - bundle "install --path vendor/bundle" + bundle "install" end it "should return the PATH present before bundle was activated" do @@ -55,10 +56,11 @@ RSpec.describe "Bundler.with_env helpers" do end end - describe "Bundler.clean_env" do + describe "Bundler.clean_env", :bundler => "< 2" do before do + bundle "config path vendor/bundle" gemfile "" - bundle "install --path vendor/bundle" + bundle "install" end it "should delete BUNDLE_PATH" do @@ -107,7 +109,7 @@ RSpec.describe "Bundler.with_env helpers" do end end - describe "Bundler.with_clean_env" do + describe "Bundler.with_clean_env", :bundler => "< 2" do it "should set ENV to clean_env in the block" do expected = Bundler.clean_env actual = Bundler.with_clean_env { ENV.to_hash } @@ -123,14 +125,14 @@ RSpec.describe "Bundler.with_env helpers" do end end - describe "Bundler.clean_system", :ruby => ">= 1.9" do + describe "Bundler.clean_system", :ruby => ">= 1.9", :bundler => "< 2" do it "runs system inside with_clean_env" do Bundler.clean_system(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh)) expect($?.exitstatus).to eq(42) end end - describe "Bundler.clean_exec", :ruby => ">= 1.9" do + describe "Bundler.clean_exec", :ruby => ">= 1.9", :bundler => "< 2" do it "runs exec inside with_clean_env" do pid = Kernel.fork do Bundler.clean_exec(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh)) |