diff options
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r-- | spec/bundler/commands/binstubs_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/commands/cache_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/commands/check_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/commands/clean_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/commands/exec_spec.rb | 21 | ||||
-rw-r--r-- | spec/bundler/commands/inject_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/commands/install_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/commands/newgem_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/commands/outdated_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/commands/platform_spec.rb | 8 | ||||
-rw-r--r-- | spec/bundler/commands/post_bundle_message_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/commands/remove_spec.rb | 2 | ||||
-rw-r--r-- | spec/bundler/commands/show_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/commands/update_spec.rb | 6 | ||||
-rw-r--r-- | spec/bundler/commands/version_spec.rb | 12 | ||||
-rw-r--r-- | spec/bundler/commands/viz_spec.rb | 2 |
16 files changed, 60 insertions, 39 deletions
diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index c66b9339ee..44456f8dbf 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -168,7 +168,7 @@ RSpec.describe "bundle binstubs <gem>" do expect(bundled_app("exec/myrackup")).to exist end - it "setting is saved for bundle install", bundler: "< 3" do + it "setting is saved for bundle install", bundler: "2" do install_gemfile <<-G source "https://gem.repo1" gem "myrack" diff --git a/spec/bundler/commands/cache_spec.rb b/spec/bundler/commands/cache_spec.rb index 3f7a627296..50289ca65a 100644 --- a/spec/bundler/commands/cache_spec.rb +++ b/spec/bundler/commands/cache_spec.rb @@ -158,7 +158,7 @@ RSpec.describe "bundle cache" do end end - context "with --path", bundler: "< 3" do + context "with --path", bundler: "2" do it "sets root directory for gems" do gemfile <<-D source "https://gem.repo1" @@ -221,7 +221,7 @@ RSpec.describe "bundle cache" do expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist end - it "puts the gems in vendor/cache even for legacy windows rubies, but prints a warning", bundler: "< 3" do + it "puts the gems in vendor/cache even for legacy windows rubies, but prints a warning", bundler: "2" do gemfile <<-D source "https://gem.repo1" gem 'myrack', :platforms => [:ruby_20, :x64_mingw_20] @@ -232,7 +232,7 @@ RSpec.describe "bundle cache" do expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist end - it "prints an error when using legacy windows rubies", bundler: "3" do + it "prints an error when using legacy windows rubies", bundler: "4" do gemfile <<-D source "https://gem.repo1" gem 'myrack', :platforms => [:ruby_20, :x64_mingw_20] diff --git a/spec/bundler/commands/check_spec.rb b/spec/bundler/commands/check_spec.rb index 150ee62878..8a68a44f0d 100644 --- a/spec/bundler/commands/check_spec.rb +++ b/spec/bundler/commands/check_spec.rb @@ -123,7 +123,7 @@ RSpec.describe "bundle check" do expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.") end - it "remembers --without option from install", bundler: "< 3" do + it "remembers --without option from install", bundler: "2" do gemfile <<-G source "https://gem.repo1" group :foo do @@ -272,7 +272,7 @@ RSpec.describe "bundle check" do expect(last_command).to be_failure end - context "--path", bundler: "< 3" do + context "--path", bundler: "2" do context "after installing gems in the proper directory" do before do gemfile <<-G diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index 2559be0205..176a125a48 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -383,7 +383,7 @@ RSpec.describe "bundle clean" do expect(out).to include("myrack (1.0.0)").and include("thin (1.0)") end - it "--clean should override the bundle setting on install", bundler: "< 3" do + it "--clean should override the bundle setting on install", bundler: "2" do gemfile <<-G source "https://gem.repo1" @@ -405,7 +405,7 @@ RSpec.describe "bundle clean" do should_not_have_gems "thin-1.0" end - it "--clean should override the bundle setting on update", bundler: "< 3" do + it "--clean should override the bundle setting on update", bundler: "2" do build_repo2 gemfile <<-G @@ -427,7 +427,7 @@ RSpec.describe "bundle clean" do should_not_have_gems "foo-1.0" end - it "automatically cleans when path has not been set", bundler: "3" do + it "automatically cleans when path has not been set", bundler: "4" do build_repo2 install_gemfile <<-G diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb index aa504ea2a7..a09f714bb6 100644 --- a/spec/bundler/commands/exec_spec.rb +++ b/spec/bundler/commands/exec_spec.rb @@ -699,6 +699,27 @@ RSpec.describe "bundle exec" do end end + describe "running gem commands in presence of rubygems plugins" do + before do + build_repo4 do + build_gem "foo" do |s| + s.write "lib/rubygems_plugin.rb", "puts 'FAIL'" + end + end + + system_gems "foo-1.0", path: default_bundle_path, gem_repo: gem_repo4 + + install_gemfile <<-G + source "https://gem.repo4" + G + end + + it "does not load plugins outside of the bundle" do + bundle "exec #{gem_cmd} -v" + expect(out).not_to include("FAIL") + end + end + context "`load`ing a ruby file instead of `exec`ing" do let(:path) { bundled_app("ruby_executable") } let(:shebang) { "#!/usr/bin/env ruby" } diff --git a/spec/bundler/commands/inject_spec.rb b/spec/bundler/commands/inject_spec.rb index 4998b6e89d..2630b8993b 100644 --- a/spec/bundler/commands/inject_spec.rb +++ b/spec/bundler/commands/inject_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle inject", bundler: "< 3" do +RSpec.describe "bundle inject", bundler: "2" do before :each do gemfile <<-G source "https://gem.repo1" @@ -79,7 +79,7 @@ Usage: "bundle inject GEM VERSION" context "when frozen" do before do bundle "install" - if Bundler.feature_flag.bundler_3_mode? + if Bundler.feature_flag.bundler_4_mode? bundle "config set --local deployment true" else bundle "config set --local frozen true" diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index 98883b1e72..df30a63c36 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -29,7 +29,7 @@ RSpec.describe "bundle install with gem sources" do expect(bundled_app_lock).to exist end - it "does not create ./.bundle by default", bundler: "< 3" do + it "does not create ./.bundle by default", bundler: "2" do gemfile <<-G source "https://gem.repo1" gem "myrack" @@ -334,14 +334,14 @@ RSpec.describe "bundle install with gem sources" do expect(the_bundle).to include_gems "myrack 1.0" end - it "allows running bundle install --system without deleting foo", bundler: "< 3" do + it "allows running bundle install --system without deleting foo", bundler: "2" do bundle "install --path vendor" bundle "install --system" FileUtils.rm_r(bundled_app("vendor")) expect(the_bundle).to include_gems "myrack 1.0" end - it "allows running bundle install --system after deleting foo", bundler: "< 3" do + it "allows running bundle install --system after deleting foo", bundler: "2" do bundle "install --path vendor" FileUtils.rm_r(bundled_app("vendor")) bundle "install --system" @@ -349,7 +349,7 @@ RSpec.describe "bundle install with gem sources" do end end - it "finds gems in multiple sources", bundler: "< 3" do + it "finds gems in multiple sources", bundler: "2" do build_repo2 do build_gem "myrack", "1.2" do |s| s.executables = "myrackup" diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 30655656a8..608f05418f 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -162,7 +162,7 @@ RSpec.describe "bundle gem" do end shared_examples_for "--rubocop flag" do - context "is deprecated", bundler: "< 3" do + context "is deprecated", bundler: "2" do before do global_config "BUNDLE_GEM__LINTER" => nil bundle "gem #{gem_name} --rubocop" @@ -198,7 +198,7 @@ RSpec.describe "bundle gem" do end shared_examples_for "--no-rubocop flag" do - context "is deprecated", bundler: "< 3" do + context "is deprecated", bundler: "2" do define_negated_matcher :exclude, :include before do @@ -1374,7 +1374,7 @@ RSpec.describe "bundle gem" do end end - context "gem.rubocop setting set to true", bundler: "< 3" do + context "gem.rubocop setting set to true", bundler: "2" do before do global_config "BUNDLE_GEM__LINTER" => nil bundle "config set gem.rubocop true" @@ -1657,7 +1657,7 @@ RSpec.describe "bundle gem" do include_examples "generating a gem" context "--ext parameter with no value" do - context "is deprecated", bundler: "< 3" do + context "is deprecated", bundler: "2" do it "prints deprecation when used after gem name" do bundle ["gem", "--ext", gem_name].compact.join(" ") expect(err).to include "[DEPRECATED]" diff --git a/spec/bundler/commands/outdated_spec.rb b/spec/bundler/commands/outdated_spec.rb index 09b0e6f32f..5c7b574f6d 100644 --- a/spec/bundler/commands/outdated_spec.rb +++ b/spec/bundler/commands/outdated_spec.rb @@ -151,7 +151,7 @@ RSpec.describe "bundle outdated" do end end - describe "with multiple, duplicated sources, with lockfile in old format", bundler: "< 3" do + describe "with multiple, duplicated sources, with lockfile in old format", bundler: "2" do before do build_repo2 do build_gem "dotenv", "2.7.6" @@ -819,7 +819,7 @@ RSpec.describe "bundle outdated" do expect(out).to include("Installing foo 1.0") end - context "after bundle install --deployment", bundler: "< 3" do + context "after bundle install --deployment", bundler: "2" do before do build_repo2 diff --git a/spec/bundler/commands/platform_spec.rb b/spec/bundler/commands/platform_spec.rb index 17183e7546..293b7ffa95 100644 --- a/spec/bundler/commands/platform_spec.rb +++ b/spec/bundler/commands/platform_spec.rb @@ -646,7 +646,7 @@ G expect(out).to eq(default_bundle_path("gems", "rails-2.3.2").to_s) end - it "fails if ruby version doesn't match", bundler: "< 3" do + it "fails if ruby version doesn't match", bundler: "2" do gemfile <<-G source "https://gem.repo1" gem "rails" @@ -658,7 +658,7 @@ G should_be_ruby_version_incorrect end - it "fails if engine doesn't match", bundler: "< 3" do + it "fails if engine doesn't match", bundler: "2" do gemfile <<-G source "https://gem.repo1" gem "rails" @@ -670,7 +670,7 @@ G should_be_engine_incorrect end - it "fails if engine version doesn't match", bundler: "< 3", jruby_only: true do + it "fails if engine version doesn't match", bundler: "2", jruby_only: true do gemfile <<-G source "https://gem.repo1" gem "rails" @@ -682,7 +682,7 @@ G should_be_engine_version_incorrect end - it "fails when patchlevel doesn't match", bundler: "< 3" do + it "fails when patchlevel doesn't match", bundler: "2" do gemfile <<-G source "https://gem.repo1" gem "myrack" diff --git a/spec/bundler/commands/post_bundle_message_spec.rb b/spec/bundler/commands/post_bundle_message_spec.rb index 7b5ac1aec9..0920b43f9b 100644 --- a/spec/bundler/commands/post_bundle_message_spec.rb +++ b/spec/bundler/commands/post_bundle_message_spec.rb @@ -142,7 +142,7 @@ Could not find gem 'not-a-gem' in rubygems repository https://gem.repo1/ or inst end end - describe "for second bundle install run", bundler: "< 3" do + describe "for second bundle install run", bundler: "2" do it "without any options" do 2.times { bundle :install } expect(out).to include(bundle_show_message) diff --git a/spec/bundler/commands/remove_spec.rb b/spec/bundler/commands/remove_spec.rb index 84505169ca..e137e74503 100644 --- a/spec/bundler/commands/remove_spec.rb +++ b/spec/bundler/commands/remove_spec.rb @@ -43,7 +43,7 @@ RSpec.describe "bundle remove" do end end - context "when --install flag is specified", bundler: "< 3" do + context "when --install flag is specified", bundler: "2" do it "removes gems from .bundle" do gemfile <<-G source "https://gem.repo1" diff --git a/spec/bundler/commands/show_spec.rb b/spec/bundler/commands/show_spec.rb index 0ff9416757..33ba0a2c04 100644 --- a/spec/bundler/commands/show_spec.rb +++ b/spec/bundler/commands/show_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle show", bundler: "< 3" do +RSpec.describe "bundle show", bundler: "2" do context "with a standard Gemfile" do before :each do install_gemfile <<-G @@ -219,6 +219,6 @@ RSpec.describe "bundle show", bundler: "< 3" do end end -RSpec.describe "bundle show", bundler: "3" do +RSpec.describe "bundle show", bundler: "4" do pending "shows a friendly error about the command removal" end diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index e3624ca04d..b9c3cd46f9 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -772,7 +772,7 @@ RSpec.describe "bundle update" do G end - it "should fail loudly", bundler: "< 3" do + it "should fail loudly", bundler: "2" do bundle "install --deployment" bundle "update", all: true, raise_on_error: false @@ -1036,7 +1036,7 @@ RSpec.describe "bundle update" do end end - context "with multiple, duplicated sources, with lockfile in old format", bundler: "< 3" do + context "with multiple, duplicated sources, with lockfile in old format", bundler: "2" do before do build_repo2 do build_gem "dotenv", "2.7.6" @@ -1558,7 +1558,7 @@ RSpec.describe "bundle update --bundler" do G lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, "2.99.9") - bundle :update, bundler: true, verbose: true, preserve_ruby_flags: true + bundle :update, bundler: true, verbose: true, preserve_ruby_flags: true, env: { "BUNDLER_4_MODE" => nil } expect(out).to include("Updating bundler to 999.0.0") expect(out).to include("Running `bundle update --bundler \"> 0.a\" --verbose` with bundler 999.0.0") diff --git a/spec/bundler/commands/version_spec.rb b/spec/bundler/commands/version_spec.rb index 307058a5dd..e62c0baf8b 100644 --- a/spec/bundler/commands/version_spec.rb +++ b/spec/bundler/commands/version_spec.rb @@ -10,36 +10,36 @@ RSpec.describe "bundle version" do end context "with -v" do - it "outputs the version", bundler: "< 3" do + it "outputs the version", bundler: "2" do bundle "-v" expect(out).to eq("Bundler version #{Bundler::VERSION}") end - it "outputs the version", bundler: "3" do + it "outputs the version", bundler: "4" do bundle "-v" expect(out).to eq(Bundler::VERSION) end end context "with --version" do - it "outputs the version", bundler: "< 3" do + it "outputs the version", bundler: "2" do bundle "--version" expect(out).to eq("Bundler version #{Bundler::VERSION}") end - it "outputs the version", bundler: "3" do + it "outputs the version", bundler: "4" do bundle "--version" expect(out).to eq(Bundler::VERSION) end end context "with version" do - it "outputs the version with build metadata", bundler: "< 3" do + it "outputs the version with build metadata", bundler: "2" do bundle "version" expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/) end - it "outputs the version with build metadata", bundler: "3" do + it "outputs the version with build metadata", bundler: "4" do bundle "version" expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit #{COMMIT_HASH}\)\z/) end diff --git a/spec/bundler/commands/viz_spec.rb b/spec/bundler/commands/viz_spec.rb index 712ded4bc4..bc02d0465d 100644 --- a/spec/bundler/commands/viz_spec.rb +++ b/spec/bundler/commands/viz_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -RSpec.describe "bundle viz", bundler: "< 3", if: Bundler.which("dot") do +RSpec.describe "bundle viz", bundler: "2", if: Bundler.which("dot") do before do realworld_system_gems "ruby-graphviz --version 1.2.5" end |