diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2018-06-14 18:35:04 +0900 |
---|---|---|
committer | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2018-06-15 16:33:27 +0900 |
commit | e314dd139b6e99417accb710dd0465f961e1b9d9 (patch) | |
tree | 0636d12f8067f352077b0a2ae7180cb75dd4999f /spec/support/matchers.rb | |
parent | 9e1a70e72f9556886442041b39adeb2e8ef587ab (diff) | |
download | bundler-e314dd139b6e99417accb710dd0465f961e1b9d9.tar.gz |
Modify localhost variable when defining URI::File. It will be provided from Ruby 2.6.
Diffstat (limited to 'spec/support/matchers.rb')
-rw-r--r-- | spec/support/matchers.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 782257a222..d7c05712ad 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -235,8 +235,9 @@ module Spec end end - def lockfile_should_be(expected) - expect(bundled_app("Gemfile.lock")).to read_as(strip_whitespace(expected)) + def lockfile_should_be(expected, actual = bundled_app("Gemfile.lock")) + expected = expected.dup.gsub(%r{file:\/\/localhost}, "file://") if defined?(URI::File) + expect(actual).to read_as(strip_whitespace(expected)) end end end |