summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pitman <michaelp@ibglobalweb.com>2017-08-30 13:08:21 +1000
committerMichael Pitman <michaelp@ibglobalweb.com>2017-08-30 13:08:21 +1000
commit22752b09366973ab9a05343aae7be9fb1bc14109 (patch)
treed984eb449ebaebae7a6a9ca7894fe1ac52fdf5bc
parentd08d8de87d459bfa1d3e3e522a4284a503855be8 (diff)
downloadbundler-22752b09366973ab9a05343aae7be9fb1bc14109.tar.gz
Change the literal regex to an eval expression in order to enable loading of the file under ruby 1.8
-rw-r--r--spec/bundler/shared_helpers_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb
index a93d81f4b5..d8f6e1ef18 100644
--- a/spec/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/shared_helpers_spec.rb
@@ -279,8 +279,13 @@ RSpec.describe Bundler::SharedHelpers do
)
end
- context "with a jruby path_separator regex", :ruby => "1.9" do # In versions of jruby that supported ruby 1.8, the path separator was the standard File::PATH_SEPARATOR
- let(:regex) { /(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):/ }
+ context "with a jruby path_separator regex", :ruby => "1.9" do
+ # In versions of jruby that supported ruby 1.8, the path separator was the standard File::PATH_SEPARATOR
+ let(:regex) {
+ # If this is stated as a literal regex we get a syntax error when simply loading this file,
+ # even if the expression is never evaluated
+ eval("/(?<!jar:file|jar|file|classpath|uri:classloader|uri|http|https):/")
+ }
it "does not exit if bundle path is the standard uri path" do
allow(Gem).to receive(:path_separator).and_return(regex)
allow(Bundler).to receive(:bundle_path) { Pathname.new("uri:classloader:/WEB-INF/gems") }