diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-13 19:17:34 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-22 18:44:22 +0100 |
commit | 029d4da57441defd8a8760af33b1ce11847f7afa (patch) | |
tree | 62ea0bd87591180c3a1acdc5dfb5c9b65162a99b /spec/runtime | |
parent | a11c104c5b6222c018248b585cca2a4f340a9a71 (diff) | |
download | bundler-029d4da57441defd8a8760af33b1ce11847f7afa.tar.gz |
Strip root path in an OS-independent way
Diffstat (limited to 'spec/runtime')
-rw-r--r-- | spec/runtime/setup_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index d86d1320ea..e247feb804 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -845,6 +845,12 @@ end end describe "when a vendored gem specification uses the :path option" do + let(:filesystem_root) do + current = Pathname.new(Dir.pwd) + current = current.parent until current == current.parent + current + end + it "should resolve paths relative to the Gemfile" do path = bundled_app(File.join("vendor", "foo")) build_lib "foo", :path => path @@ -866,7 +872,7 @@ end end it "should make sure the Bundler.root is really included in the path relative to the Gemfile" do - relative_path = File.join("vendor", Dir.pwd[1..-1], "foo") + relative_path = File.join("vendor", Dir.pwd.gsub(/^#{filesystem_root}/, "")) absolute_path = bundled_app(relative_path) FileUtils.mkdir_p(absolute_path) build_lib "foo", :path => absolute_path |