diff options
author | Bundlerbot <bot@bundler.io> | 2020-01-04 16:42:37 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2020-01-04 16:42:37 +0000 |
commit | 900eed358a728818eaec235fe3f2986d75241acb (patch) | |
tree | 188de3e87d506ee21e3a46da16ccfd47af480198 | |
parent | e70d0f3d02c8c084b61969e71d1fa28a15a6d0ca (diff) | |
parent | b5de85ea309f401bfbc460e75d8ceaa6f8719a4d (diff) | |
download | bundler-900eed358a728818eaec235fe3f2986d75241acb.tar.gz |
Merge #7541
7541: Adapt `Bundler#which` test to Windows r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that this spec was failing under Windows.
### What was your diagnosis of the problem?
My diagnosis was that the test needs Windows specific paths.
### What is your fix for the problem, implemented in this PR?
My fix is to separate the test per OS.
### Why did you choose this fix out of the possible options?
I chose this fix because it was discussed and considered the better fix at https://github.com/bundler/bundler/issues/6875.
Closes https://github.com/bundler/bundler/issues/6875.
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | spec/bundler/bundler_spec.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 247838600b..27477465bb 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -124,7 +124,15 @@ RSpec.describe Bundler do describe "#which" do let(:executable) { "executable" } - let(:path) { %w[/a /b c ../d /e] } + + let(:path) do + if Gem.win_platform? + %w[C:/a C:/b C:/c C:/../d C:/e] + else + %w[/a /b c ../d /e] + end + end + let(:expected) { "executable" } before do @@ -149,7 +157,13 @@ RSpec.describe Bundler do it_behaves_like "it returns the correct executable" context "when the executable in inside a quoted path" do - let(:expected) { "/e/executable" } + let(:expected) do + if Gem.win_platform? + "C:/e/executable" + else + "/e/executable" + end + end it_behaves_like "it returns the correct executable" end |