From 8d9fc8466f639eb2740ac406947a047505fcdea6 Mon Sep 17 00:00:00 2001 From: David Rodríguez Date: Thu, 4 Jul 2019 22:14:19 +0200 Subject: [bundler/bundler] Reuse `lockfile` spec helper https://github.com/bundler/bundler/commit/e6a03f1102 --- spec/bundler/install/gemfile/git_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'spec/bundler/install/gemfile/git_spec.rb') diff --git a/spec/bundler/install/gemfile/git_spec.rb b/spec/bundler/install/gemfile/git_spec.rb index fe51650f76..f2dcd33d7d 100644 --- a/spec/bundler/install/gemfile/git_spec.rb +++ b/spec/bundler/install/gemfile/git_spec.rb @@ -1003,10 +1003,8 @@ RSpec.describe "bundle install with git sources" do update_git "valim" new_revision = revision_for(lib_path("valim-1.0")) - lockfile = File.read(bundled_app("Gemfile.lock")) - File.open(bundled_app("Gemfile.lock"), "w") do |file| - file.puts lockfile.gsub(/revision: #{old_revision}/, "revision: #{new_revision}") - end + old_lockfile = File.read(bundled_app("Gemfile.lock")) + lockfile(bundled_app("Gemfile.lock"), old_lockfile.gsub(/revision: #{old_revision}/, "revision: #{new_revision}")) bundle "install" -- cgit v1.2.3