diff options
author | Michael Pitman <michaelp@ibglobalweb.com> | 2017-08-30 13:41:23 +1000 |
---|---|---|
committer | Michael Pitman <michaelp@ibglobalweb.com> | 2017-08-30 13:41:23 +1000 |
commit | 2c80476d3ee87fc11d5b3d0bbd4e3a5db2366c3e (patch) | |
tree | b796478b59353955a3d9adc05e0f877d4073bdd8 | |
parent | 6f83af71889e9c837fc83ec1fd09bd25188d4eff (diff) | |
download | bundler-2c80476d3ee87fc11d5b3d0bbd4e3a5db2366c3e.tar.gz |
Improved the way the string was interpreted as a Regex by using the regex constructor
-rw-r--r-- | spec/bundler/shared_helpers_spec.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb index bd9cb6b402..2df92df906 100644 --- a/spec/bundler/shared_helpers_spec.rb +++ b/spec/bundler/shared_helpers_spec.rb @@ -281,11 +281,7 @@ RSpec.describe Bundler::SharedHelpers do 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) do - # 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):/") - end + let(:regex) { Regexp.new('(?<!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") } |