summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-12-27 09:28:09 +0700
committerSamuel Giddins <segiddins@segiddins.me>2017-12-27 09:28:09 +0700
commit3f244c698d1db82d19e8cd660ae0c0f80960f8fe (patch)
tree858cd14e8771764875675c4548f3c42ff5c55a0d /spec/commands
parent2cc5221263cd5fe8d347a9d3de9aff9fed685742 (diff)
parent0034ef3416ca94d00839361dbeb0485b10a09c51 (diff)
downloadbundler-3f244c698d1db82d19e8cd660ae0c0f80960f8fe.tar.gz
Merge tag 'v1.16.1'
Version 1.16.1 # gpg: Signature made Fri Dec 22 01:46:37 2017 +07 # gpg: using ? key C3DA1D6CEFC720FA # gpg: Can't check signature: unknown pubkey algorithm # Conflicts: # lib/bundler/version.rb # spec/commands/exec_spec.rb # spec/realworld/double_check_spec.rb # spec/runtime/with_clean_env_spec.rb # spec/spec_helper.rb
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/exec_spec.rb30
-rw-r--r--spec/commands/lock_spec.rb10
-rw-r--r--spec/commands/newgem_spec.rb4
-rw-r--r--spec/commands/pristine_spec.rb5
4 files changed, 29 insertions, 20 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index ae31487937..af88f3f043 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -29,7 +29,7 @@ RSpec.describe "bundle exec" do
gem "rack"
G
- bundle "exec 'cd #{tmp("gems")} && rackup'"
+ bundle "exec 'cd #{tmp("gems")} && rackup'", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" }
expect(out).to include("1.0.0")
end
@@ -42,7 +42,7 @@ RSpec.describe "bundle exec" do
it "works when exec'ing to ruby" do
install_gemfile 'gem "rack"'
- bundle "exec ruby -e 'puts %{hi}'"
+ bundle "exec ruby -e 'puts %{hi}'", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" }
expect(out).to eq("hi")
end
@@ -76,7 +76,9 @@ RSpec.describe "bundle exec" do
G
install_gemfile ""
- sys_exec("#{Gem.ruby} #{command.path}")
+ with_env_vars "RUBYOPT" => "-r#{spec_dir.join("support/hax")}" do
+ sys_exec "#{Gem.ruby} #{command.path}"
+ end
if Bundler.current_ruby.ruby_2?
expect(out).to eq("")
@@ -237,7 +239,7 @@ RSpec.describe "bundle exec" do
G
[true, false].each do |l|
bundle! "config disable_exec_load #{l}"
- bundle "exec rackup"
+ bundle "exec rackup", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" }
expect(last_command.stderr).to include "rack is not part of the bundle. Add it to your Gemfile."
end
end
@@ -339,14 +341,14 @@ RSpec.describe "bundle exec" do
end
it "works when unlocked" do
- bundle "exec 'cd #{tmp("gems")} && rackup'"
+ bundle "exec 'cd #{tmp("gems")} && rackup'", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" }
expect(out).to eq("1.0.0")
expect(out).to include("1.0.0")
end
it "works when locked" do
expect(the_bundle).to be_locked
- bundle "exec 'cd #{tmp("gems")} && rackup'"
+ bundle "exec 'cd #{tmp("gems")} && rackup'", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" }
expect(out).to include("1.0.0")
end
end
@@ -472,7 +474,7 @@ RSpec.describe "bundle exec" do
Bundler.rubygems.extend(Monkey)
G
bundle "install --deployment"
- bundle "exec ruby -e '`#{bindir.join("bundler")} -v`; puts $?.success?'"
+ bundle "exec ruby -e '`#{bindir.join("bundler")} -v`; puts $?.success?'", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" }
expect(out).to match("true")
end
end
@@ -512,7 +514,7 @@ RSpec.describe "bundle exec" do
let(:expected) { [exec, args, rack, process].join("\n") }
let(:expected_err) { "" }
- subject { bundle "exec #{path} arg1 arg2" }
+ subject { bundle "exec #{path} arg1 arg2", :env => { :RUBYOPT => "-r#{spec_dir.join("support/hax")}" } }
shared_examples_for "it runs" do
it "like a normally executed executable" do
@@ -550,6 +552,7 @@ RSpec.describe "bundle exec" do
ex << "raise SignalException, 'SIGTERM'\n"
ex
end
+ let(:expected_err) { ENV["TRAVIS"] ? "Terminated" : "" }
let(:exit_code) do
# signal mask 128 + plus signal 15 -> TERM
# this is specified by C99
@@ -778,10 +781,13 @@ __FILE__: #{path.to_s.inspect}
file.chmod(0o777)
aggregate_failures do
- expect(bundle!("exec #{file}", :system_bundler => true, :artifice => nil)).to eq(expected)
- expect(bundle!("exec bundle exec #{file}", :system_bundler => true, :artifice => nil)).to eq(expected)
- expect(bundle!("exec ruby #{file}", :system_bundler => true, :artifice => nil)).to eq(expected)
- expect(run!(file.read, :no_lib => true, :artifice => nil)).to eq(expected)
+ expect(bundle!("exec #{file}", :artifice => nil)).to eq(expected)
+ expect(bundle!("exec bundle exec #{file}", :artifice => nil)).to eq(expected)
+ expect(bundle!("exec ruby #{file}", :artifice => nil)).to eq(expected)
+ # Ignore expectaion for default bundler gem conflict.
+ unless ENV["BUNDLER_SPEC_SUB_VERSION"]
+ expect(run!(file.read, :no_lib => true, :artifice => nil)).to eq(expected)
+ end
end
# sanity check that we get the newer, custom version without bundler
diff --git a/spec/commands/lock_spec.rb b/spec/commands/lock_spec.rb
index 8edbb95b0f..b08cc865b1 100644
--- a/spec/commands/lock_spec.rb
+++ b/spec/commands/lock_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe "bundle lock" do
before :each do
gemfile <<-G
- source "file://#{repo}"
+ source "file://localhost#{repo}"
gem "rails"
gem "with_license"
gem "foo"
@@ -21,7 +21,7 @@ RSpec.describe "bundle lock" do
@lockfile = strip_lockfile <<-L
GEM
- remote: file:#{repo}/
+ remote: file://localhost#{repo}/
specs:
actionmailer (2.3.2)
activesupport (= 2.3.2)
@@ -228,7 +228,7 @@ RSpec.describe "bundle lock" do
end
gemfile <<-G
- source "file:#{gem_repo4}"
+ source "file://localhost#{gem_repo4}"
gem "mixlib-shellout"
gem "gssapi"
@@ -238,7 +238,7 @@ RSpec.describe "bundle lock" do
expect(the_bundle.lockfile).to read_as(strip_whitespace(<<-G))
GEM
- remote: file:#{gem_repo4}/
+ remote: file://localhost#{gem_repo4}/
specs:
ffi (1.9.14-x86-mingw32)
gssapi (1.2.0)
@@ -263,7 +263,7 @@ RSpec.describe "bundle lock" do
expect(the_bundle.lockfile).to read_as(strip_whitespace(<<-G))
GEM
- remote: file:#{gem_repo4}/
+ remote: file://localhost#{gem_repo4}/
specs:
ffi (1.9.14)
ffi (1.9.14-x86-mingw32)
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index 494599abf1..1a3e8236b6 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -191,7 +191,7 @@ RSpec.describe "bundle gem" do
it "generates a valid gemspec" do
in_app_root
- bundle "gem newgem --bin"
+ bundle! "gem newgem --bin"
process_file(bundled_app("newgem", "newgem.gemspec")) do |line|
# Simulate replacing TODOs with real values
@@ -211,7 +211,7 @@ RSpec.describe "bundle gem" do
end
Dir.chdir(bundled_app("newgem")) do
- system_gems ["rake-10.0.2"], :path => :bundle_path
+ system_gems ["rake-10.0.2", :bundler], :path => :bundle_path
bundle! "exec rake build"
end
diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb
index 108606e8aa..4642a8167d 100644
--- a/spec/commands/pristine_spec.rb
+++ b/spec/commands/pristine_spec.rb
@@ -41,11 +41,14 @@ RSpec.describe "bundle pristine" do
end
it "does not delete the bundler gem" do
+ ENV["BUNDLER_SPEC_KEEP_DEFAULT_BUNDLER_GEM"] = "true"
system_gems :bundler
bundle! "install"
bundle! "pristine", :system_bundler => true
bundle! "-v", :system_bundler => true
- expect(out).to end_with(Bundler::VERSION)
+ # An old rubygems couldn't handle a correct version of vendoered bundler.
+ bundler_version = Gem::VERSION < "2.1" ? "1.16.0" : Bundler::VERSION
+ expect(out).to end_with(bundler_version)
end
end