summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-06-21 22:43:42 +0000
committerSamuel Giddins <segiddins@segiddins.me>2017-07-17 12:03:17 -0500
commitabd487c2d7cb21def85d9660f17328a62eeaf638 (patch)
tree984544d9e26518ddfef9e8229d3751488a8fa9d5 /spec
parent571aa4f790dc8849a377566f553533b4759cd95e (diff)
downloadbundler-abd487c2d7cb21def85d9660f17328a62eeaf638.tar.gz
Auto merge of #5804 - bundler:seg-remove-postit-trampoline, r=indirect
Completely remove the postit trampoline ### What was the end-user problem that led to this PR? The problem was the bundler trampoline we tried to introduce never completely worked, it worked even less with bundler installed as a default gem (as we intend to do with RubyGems, like, a year ago), and it worked by doing disgusting things that we couldn't be confident would work under all circumstances. ### Was was your diagnosis of the problem? My diagnosis was our best bet was to completely remove the trampoline from bundler itself. We intend to address the user story of switching bundler versions in RubyGems directly, where the gymnastics required will hopefully be much less obtrusive. Additionally ### What is your fix for the problem, implemented in this PR? My fix is to completely delete all references to trampolining / postit from Bundler and admit defeat. ### Why did you choose this fix out of the possible options? I chose this fix because I'm unwilling to maintain the trampoline any longer, and since it's never been enabled, I feel this is my last chance to pull it from Bundler before I'm stuck maintaining code that doesn't work for all eternity. This will also _finally_ unblock me shipping RubyGems 2.7. (cherry picked from commit bd95735df25ceac9de8f2186be37079f6cf3d385) # Conflicts: # doc/development/SETUP.md # lib/bundler/postit_trampoline.rb # spec/other/trampoline_spec.rb
Diffstat (limited to 'spec')
-rw-r--r--spec/commands/install_spec.rb21
-rw-r--r--spec/other/trampoline_spec.rb194
-rw-r--r--spec/support/helpers.rb1
3 files changed, 0 insertions, 216 deletions
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index 49eee01910..0c149d93b9 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -485,25 +485,4 @@ RSpec.describe "bundle install with gem sources" do
"setting them for authentication.")
end
end
-
- describe "warns user if Bundler is outdated" do
- it "warns only once and is > 1.13.0.rc.1" do
- gemfile <<-G
- source "file://#{gem_repo1}"
- G
-
- bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => "999" }
- expect(out).to include("You're running Bundler 999 but this project uses #{Bundler::VERSION}.")
-
- bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => "999" }
- expect(out).not_to include("You're running Bundler 999 but this project uses #{Bundler::VERSION}.")
- end
-
- it "should not print warning if versions match" do
- bundle :init
- bundle :install, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => Bundler::VERSION }
- expect(out).to start_with("Running `bundle install --no-color` with bundler #{Bundler::VERSION}\nThe Gemfile specifies no dependencies")
- expect(out).not_to include("You're running Bundler #{Bundler::VERSION} but this project uses #{Bundler::VERSION}.")
- end
- end
end
diff --git a/spec/other/trampoline_spec.rb b/spec/other/trampoline_spec.rb
deleted file mode 100644
index 39de7048c7..0000000000
--- a/spec/other/trampoline_spec.rb
+++ /dev/null
@@ -1,194 +0,0 @@
-# frozen_string_literal: true
-require "spec_helper"
-
-RSpec.describe "bundler version trampolining" do
- before do
- ENV["BUNDLE_TRAMPOLINE_DISABLE"] = nil
- ENV["BUNDLE_TRAMPOLINE_FORCE"] = "true"
- FileUtils.rm_rf(system_gem_path)
- FileUtils.cp_r(base_system_gems, system_gem_path)
- end
-
- context "version guessing" do
- shared_examples_for "guesses" do |version|
- it "guesses the correct bundler version" do
- bundle! "--version"
- expect(out).to eq("Bundler version #{version}")
-
- if bundled_app("Gemfile").file?
- bundle! "exec ruby -e 'puts Bundler::VERSION'"
- expect(out).to eq(version)
- end
- end
- end
-
- context "with a lockfile" do
- before do
- install_gemfile ""
- lockfile lockfile.sub(Bundler::VERSION, "1.12.0")
- end
-
- include_examples "guesses", "1.12.0"
- end
-
- context "with BUNDLER_VERSION" do
- before do
- ENV["BUNDLER_VERSION"] = "1.12.0"
- end
-
- context "with a lockfile" do
- before { install_gemfile "" }
- include_examples "guesses", "1.12.0"
- end
-
- context "without a lockfile" do
- include_examples "guesses", "1.12.0"
- end
- end
-
- context "with no hints" do
- include_examples "guesses", Bundler::VERSION
- end
-
- context "with a gemfile and no lockfile" do
- before do
- gemfile ""
- end
-
- include_examples "guesses", Bundler::VERSION
- end
- end
-
- context "without BUNDLE_TRAMPOLINE_FORCE" do
- before { ENV["BUNDLE_TRAMPOLINE_FORCE"] = nil }
-
- context "when the version is >= 2" do
- let(:version) { "2.7182818285" }
- before do
- simulate_bundler_version version do
- install_gemfile! ""
- end
- end
-
- it "trampolines automatically", :realworld => true do
- bundle "--version"
- expect(err).to include("Installing locked Bundler version #{version}...")
- end
- end
- end
-
- context "installing missing bundler versions", :realworld => true do
- before do
- ENV["BUNDLER_VERSION"] = "1.12.3"
- if Bundler::RubygemsIntegration.provides?("< 2.6.4")
- # necessary since we intall with 2.6.4 but the specs can run against
- # older versions that match againt the "gem" invocation
- %w(bundle bundler).each do |exe|
- system_gem_path.join("bin", exe).open("a") do |f|
- f << %(\ngem "bundler", ">= 0.a"\n)
- end
- end
- end
- end
-
- it "guesses & installs the correct bundler version" do
- expect(system_gem_path.join("gems", "bundler-1.12.3")).not_to exist
- bundle! "--version"
- expect(out).to eq("Bundler version 1.12.3")
- expect(system_gem_path.join("gems", "bundler-1.12.3")).to exist
- end
-
- it "fails gracefully when installing the bundler fails" do
- ENV["BUNDLER_VERSION"] = "9999"
- bundle "--version"
- expect(err).to start_with(<<-E.strip)
-Installing locked Bundler version 9999...
-Installing the inferred bundler version (= 9999) failed.
-If you'd like to update to the current bundler version (#{Bundler::VERSION}) in this project, run `bundle update --bundler`.
-The error was:
- E
- end
-
- it "displays installing message before install is started" do
- expect(system_gem_path.join("gems", "bundler-1.12.3")).not_to exist
- bundle! "--version"
- expect(err).to include("Installing locked Bundler version #{ENV["BUNDLER_VERSION"]}...")
- end
-
- it "doesn't display installing message if locked version is installed" do
- expect(system_gem_path.join("gems", "bundler-1.12.3")).not_to exist
- bundle! "--version"
- expect(system_gem_path.join("gems", "bundler-1.12.3")).to exist
- bundle! "--version"
- expect(err).not_to include("Installing locked Bundler version = #{ENV["BUNDLER_VERSION"]}...")
- end
- end
-
- context "bundle update --bundler" do
- before do
- simulate_bundler_version("1.11.1") do
- install_gemfile ""
- end
- end
-
- it "updates to the specified version" do
- # HACK: since no released bundler version actually supports this feature!
- bundle "update --bundler=1.12.0"
- expect(out).to include("Unknown switches '--bundler=1.12.0'")
- end
-
- it "updates to the specified (running) version" do
- # HACK: since no released bundler version actually supports this feature!
- bundle! "update --bundler=#{Bundler::VERSION}"
- bundle! "--version"
- expect(out).to eq("Bundler version #{Bundler::VERSION}")
- end
-
- it "updates to the running version" do
- # HACK: since no released bundler version actually supports this feature!
- bundle! "update --bundler"
- bundle! "--version"
- expect(out).to eq("Bundler version #{Bundler::VERSION}")
- end
- end
-
- context "-rbundler/setup" do
- before do
- simulate_bundler_version("1.12.0") do
- install_gemfile ""
- end
- end
-
- it "uses the locked version" do
- ruby! <<-R
- require "bundler/setup"
- puts Bundler::VERSION
- R
- expect(err).to be_empty
- expect(out).to include("1.12.0")
- end
- end
-
- context "warnings" do
- before do
- simulate_bundler_version("1.12.0") do
- install_gemfile ""
- end
- end
-
- it "warns user if Bundler is outdated and is < 1.13.0.rc.1" do
- ENV["BUNDLER_VERSION"] = "1.12.0"
- bundle! "install"
- expect(out).to include(<<-WARN.strip)
-You're running Bundler #{Bundler::VERSION} but this project uses #{ENV["BUNDLER_VERSION"]}. To update, run `bundle update --bundler`.
- WARN
- end
- end
-
- context "with --verbose" do
- it "prints the running command" do
- bundle! "config", :verbose => true, :env => { "BUNDLE_POSTIT_TRAMPOLINING_VERSION" => Bundler::VERSION }
- expect(out).to start_with("Running `bundle config --verbose` with bundler #{Bundler::VERSION}")
- end
- end
-end
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index a1b74d2726..d971ea92c3 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -12,7 +12,6 @@ module Spec
end
FileUtils.mkdir_p(home)
FileUtils.mkdir_p(tmpdir)
- ENV["BUNDLE_TRAMPOLINE_DISABLE"] = "1"
Bundler.reset!
Bundler.ui = nil
Bundler.ui # force it to initialize