summaryrefslogtreecommitdiff
path: root/spec/bundler/runtime
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 06:15:44 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-12 06:15:44 +0000
commita1a20cfaa2cf73ae8daaf2123d7c5b513427162e (patch)
tree7f112577119ebda6c3dfd71cbc24f1bc559280ae /spec/bundler/runtime
parentf1c33950998bf2d38d9416aa4f5dfe7f9f869f86 (diff)
Merge 1-16-stable branch of bundler.
It's rc version for bundler-1.16.1. I'm going to update it version after official release from bundler team. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/runtime')
-rw-r--r--spec/bundler/runtime/executable_spec.rb29
-rw-r--r--spec/bundler/runtime/inline_spec.rb4
-rw-r--r--spec/bundler/runtime/with_clean_env_spec.rb2
3 files changed, 30 insertions, 5 deletions
diff --git a/spec/bundler/runtime/executable_spec.rb b/spec/bundler/runtime/executable_spec.rb
index 388ee049d0..dcee234e15 100644
--- a/spec/bundler/runtime/executable_spec.rb
+++ b/spec/bundler/runtime/executable_spec.rb
@@ -158,4 +158,33 @@ RSpec.describe "Running bin/* commands" do
expect(bundled_app("bin/rackup").read).to_not eq("OMG")
end
+
+ it "use BUNDLE_GEMFILE gemfile for binstub" do
+ # context with bin/bunlder w/ default Gemfile
+ bundle! "binstubs bundler"
+
+ # generate other Gemfile with executable gem
+ build_repo2 do
+ build_gem("bindir") {|s| s.executables = "foo" }
+ end
+
+ create_file("OtherGemfile", <<-G)
+ source "file://#{gem_repo2}"
+ gem 'bindir'
+ G
+
+ # generate binstub for executable from non default Gemfile (other then bin/bundler version)
+ ENV["BUNDLE_GEMFILE"] = "OtherGemfile"
+ bundle "install"
+ bundle! "binstubs bindir"
+
+ # remove user settings
+ ENV["BUNDLE_GEMFILE"] = nil
+
+ # run binstub for non default Gemfile
+ gembin "foo"
+
+ expect(exitstatus).to eq(0) if exitstatus
+ expect(out).to eq("1.0")
+ end
end
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb
index dcaba3ab9d..18ca246199 100644
--- a/spec/bundler/runtime/inline_spec.rb
+++ b/spec/bundler/runtime/inline_spec.rb
@@ -43,10 +43,6 @@ RSpec.describe "bundler/inline#gemfile" do
build_lib "eight", "1.0.0" do |s|
s.write "lib/eight.rb", "puts 'eight'"
end
-
- build_lib "four", "1.0.0" do |s|
- s.write "lib/four.rb", "puts 'four'"
- end
end
it "requires the gems" do
diff --git a/spec/bundler/runtime/with_clean_env_spec.rb b/spec/bundler/runtime/with_clean_env_spec.rb
index 55e45460db..05b334c28a 100644
--- a/spec/bundler/runtime/with_clean_env_spec.rb
+++ b/spec/bundler/runtime/with_clean_env_spec.rb
@@ -80,7 +80,7 @@ RSpec.describe "Bundler.with_env helpers" do
it "should clean up RUBYLIB", :ruby_repo do
code = "print Bundler.clean_env['RUBYLIB']"
ENV["RUBYLIB"] = root.join("lib").to_s + File::PATH_SEPARATOR + "/foo"
- result = bundle("exec ruby -e #{code.inspect}")
+ result = bundle("exec '#{Gem.ruby}' -e #{code.inspect}")
expect(result).to eq("/foo")
end