diff options
Diffstat (limited to 'spec/bundler/commands/install_spec.rb')
-rw-r--r-- | spec/bundler/commands/install_spec.rb | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb index d570bac44a..66b618c2b1 100644 --- a/spec/bundler/commands/install_spec.rb +++ b/spec/bundler/commands/install_spec.rb @@ -622,6 +622,7 @@ RSpec.describe "bundle install with gem sources" do end it "writes current Ruby version to Gemfile.lock" do + checksums = checksums_section_when_existing expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ @@ -631,9 +632,7 @@ RSpec.describe "bundle install with gem sources" do #{lockfile_platforms} DEPENDENCIES - - CHECKSUMS - + #{checksums} RUBY VERSION #{Bundler::RubyVersion.system} @@ -648,6 +647,8 @@ RSpec.describe "bundle install with gem sources" do source "#{file_uri_for(gem_repo1)}" G + checksums = checksums_section_when_existing + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo1)}/ @@ -657,9 +658,7 @@ RSpec.describe "bundle install with gem sources" do #{lockfile_platforms} DEPENDENCIES - - CHECKSUMS - + #{checksums} RUBY VERSION #{Bundler::RubyVersion.system} @@ -1074,11 +1073,11 @@ RSpec.describe "bundle install with gem sources" do gem "loofah", "~> 2.12.0" G - checksums = checksum_section do |c| - c.repo_gem gem_repo4, "crass", "1.0.6" - c.repo_gem gem_repo4, "loofah", "2.12.0" - c.repo_gem gem_repo4, "nokogiri", "1.12.4", "x86_64-darwin" - c.repo_gem gem_repo4, "racca", "1.5.2" + checksums = checksums_section do |c| + c.checksum gem_repo4, "crass", "1.0.6" + c.checksum gem_repo4, "loofah", "2.12.0" + c.checksum gem_repo4, "nokogiri", "1.12.4", "x86_64-darwin" + c.checksum gem_repo4, "racca", "1.5.2" end lockfile <<-L @@ -1099,10 +1098,7 @@ RSpec.describe "bundle install with gem sources" do DEPENDENCIES loofah (~> 2.12.0) - - CHECKSUMS - #{checksums} - + #{checksums} RUBY VERSION #{Bundler::RubyVersion.system} @@ -1118,12 +1114,12 @@ RSpec.describe "bundle install with gem sources" do bundle "install", :artifice => "compact_index" end - expected_checksums = checksum_section do |c| - c.repo_gem gem_repo4, "crass", "1.0.6" - c.repo_gem gem_repo4, "loofah", "2.12.0" - c.repo_gem gem_repo4, "nokogiri", "1.12.4", "x86_64-darwin" - c.repo_gem gem_repo4, "nokogiri", "1.12.4", "x86_64-linux" - c.repo_gem gem_repo4, "racca", "1.5.2" + checksums = checksums_section_when_existing do |c| + c.checksum gem_repo4, "crass", "1.0.6" + c.checksum gem_repo4, "loofah", "2.12.0" + c.checksum gem_repo4, "nokogiri", "1.12.4", "x86_64-darwin" + c.checksum gem_repo4, "racca", "1.5.2" + c.checksum gem_repo4, "nokogiri", "1.12.4", "x86_64-linux" end expect(lockfile).to eq <<~L @@ -1146,10 +1142,7 @@ RSpec.describe "bundle install with gem sources" do DEPENDENCIES loofah (~> 2.12.0) - - CHECKSUMS - #{expected_checksums} - + #{checksums} RUBY VERSION #{Bundler::RubyVersion.system} |