1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Reuse lockfile spec helper

e6a03f1102
This commit is contained in:
David Rodríguez 2019-07-04 22:14:19 +02:00 committed by Hiroshi SHIBATA
parent 2f1d52c266
commit 8d9fc8466f
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 3 additions and 7 deletions

View file

@ -568,9 +568,7 @@ RSpec.describe "bundle clean" do
gemfile_lock.each_with_index do |line, index|
gemfile_lock[index] = line[0..(11 + 7)] if line.include?(" revision:")
end
File.open(bundled_app("Gemfile.lock"), "w") do |file|
file.print gemfile_lock.join("\n")
end
lockfile(bundled_app("Gemfile.lock"), gemfile_lock.join("\n"))
bundle "install", forgotten_command_line_options(:path => "vendor/bundle")

View file

@ -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"