summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-16 18:27:37 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-16 19:20:07 +0100
commit8ce0824c39cc35e179ce43678b3f8bb3f798abc6 (patch)
treeabc352c2fd89a692bf82d0e247894accce9d1abc /spec/commands
parent4045ba4bb1b19c8c43178daae1918f38d11c6af6 (diff)
downloadbundler-8ce0824c39cc35e179ce43678b3f8bb3f798abc6.tar.gz
Fix another silent rubygems issuefix_another_silent_rubygems_issue
We might be shelling out to rubygems in a `bundle exec` context. In the case where we don't shell out to the `gem` binstub directly, the previous trick wouldn't work. Instead, reset the rubygems ui right after `bundler/setup`, so that if we end up shelling out to rubygems, it will use its default shell (non-silent). The best place to fix this would probably be right inside the `gem` script, but even if we fix it there, we'll need workarounds for previous rubygems versions inside `bundler` so I think this is good for now.
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/exec_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index c1d6e4c25a..42f760ab12 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -61,6 +61,12 @@ RSpec.describe "bundle exec" do
expect(out).to eq(Gem::VERSION)
end
+ it "works when exec'ing to rubygems through sh -c" do
+ install_gemfile 'gem "rack"'
+ bundle "exec sh -c '#{gem_cmd} --version'"
+ expect(out).to eq(Gem::VERSION)
+ end
+
it "respects custom process title when loading through ruby" do
script_that_changes_its_own_title_and_checks_if_picked_up_by_ps_unix_utility = <<~'RUBY'
Process.setproctitle("1-2-3-4-5-6-7-8-9-10-11-12-13-14-15")