summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorooooooo-q <ooooooo-q@users.noreply.github.com>2021-11-27 15:17:48 +0900
committergit <svn-admin@ruby-lang.org>2021-11-30 01:29:34 +0900
commitaf59d35570d398bd590bebd11602bcb039454c0d (patch)
tree630b2a53d3d2378303d9b454312a73cd7d4da785 /spec
parenta60aba18f04f6427e9b330f95f162c55f04a4971 (diff)
[rubygems/rubygems] Fix escape of filenames in `bundle doctor`
https://github.com/rubygems/rubygems/commit/3ede1435ea
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/doctor_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/bundler/commands/doctor_spec.rb b/spec/bundler/commands/doctor_spec.rb
index d62d83cc51..860b638f06 100644
--- a/spec/bundler/commands/doctor_spec.rb
+++ b/spec/bundler/commands/doctor_spec.rb
@@ -133,4 +133,14 @@ RSpec.describe "bundle doctor" do
end
end
end
+
+ context "when home contains filesname with special characters" do
+ it "escape filename before command execute" do
+ doctor = Bundler::CLI::Doctor.new({})
+ expect(doctor).to receive(:`).with("/usr/bin/otool -L \\$\\(date\\)\\ \\\"\\'\\\\.bundle").and_return("dummy string")
+ doctor.dylibs_darwin('$(date) "\'\.bundle')
+ expect(doctor).to receive(:`).with("/usr/bin/ldd \\$\\(date\\)\\ \\\"\\'\\\\.bundle").and_return("dummy string")
+ doctor.dylibs_ldd('$(date) "\'\.bundle')
+ end
+ end
end