diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index 0809258859e..e9c366009a2 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -76,7 +76,7 @@ end it "does not update the lockfile's bundler version if nothing changed during bundle install" do - version = "#{Bundler::VERSION.split(".").first}.0.0.0.a" + version = "#{Bundler::VERSION.split(".").first}.0.0.a" lockfile <<-L GEM diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 151c99c3ff9..896d60435ed 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -268,18 +268,22 @@ def create_file(*args) end def gemfile(*args) - if args.empty? + contents = args.shift + + if contents.nil? File.open("Gemfile", "r", &:read) else - create_file("Gemfile", *args) + create_file("Gemfile", contents, *args) end end def lockfile(*args) - if args.empty? + contents = args.shift + + if contents.nil? File.open("Gemfile.lock", "r", &:read) else - create_file("Gemfile.lock", *args) + create_file("Gemfile.lock", normalize_uri_file(contents), *args) end end diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 0a9285837a7..f9efe32a38a 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -194,7 +194,7 @@ def indent(string, padding = 4, indent_character = " ") RSpec::Matchers.alias_matcher :include_gem, :include_gems def have_lockfile(expected) - read_as(strip_whitespace(expected)) + read_as(normalize_uri_file(strip_whitespace(expected))) end def plugin_should_be_installed(*names) @@ -212,7 +212,7 @@ def plugin_should_not_be_installed(*names) end def lockfile_should_be(expected) - expect(bundled_app("Gemfile.lock")).to read_as(normalize_uri_file(strip_whitespace(expected))) + expect(bundled_app("Gemfile.lock")).to have_lockfile(expected) end def gemfile_should_be(expected)