diff options
Diffstat (limited to 'spec/bundler/commands')
-rw-r--r-- | spec/bundler/commands/lock_spec.rb | 139 | ||||
-rw-r--r-- | spec/bundler/commands/update_spec.rb | 16 |
2 files changed, 151 insertions, 4 deletions
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb index ff387a5990..4426c484fb 100644 --- a/spec/bundler/commands/lock_spec.rb +++ b/spec/bundler/commands/lock_spec.rb @@ -11,6 +11,18 @@ RSpec.describe "bundle lock" do gem "foo" G + expected_checksums = construct_checksum_section do |c| + c.repo_gem repo, "actionmailer", "2.3.2" + c.repo_gem repo, "actionpack", "2.3.2" + c.repo_gem repo, "activerecord", "2.3.2" + c.repo_gem repo, "activeresource", "2.3.2" + c.repo_gem repo, "activesupport", "2.3.2" + c.repo_gem repo, "foo", "1.0" + c.repo_gem repo, "rails", "2.3.2" + c.repo_gem repo, "rake", "13.0.1" + c.repo_gem repo, "weakling", "0.0.3" + end + @lockfile = <<~L GEM remote: #{file_uri_for(repo)}/ @@ -43,6 +55,7 @@ RSpec.describe "bundle lock" do weakling CHECKSUMS + #{expected_checksums} BUNDLED WITH #{Bundler::VERSION} @@ -107,6 +120,7 @@ RSpec.describe "bundle lock" do foo CHECKSUMS + #{checksum_for_repo_gem repo, "foo", "1.0"} BUNDLED WITH #{Bundler::VERSION} @@ -501,6 +515,10 @@ RSpec.describe "bundle lock" do DEPENDENCIES nokogiri + CHECKSUMS + #{checksum_for_repo_gem gem_repo4, "nokogiri", "1.12.0"} + #{checksum_for_repo_gem gem_repo4, "nokogiri", "1.12.0", "x86_64-darwin"} + BUNDLED WITH #{Bundler::VERSION} L @@ -521,6 +539,9 @@ RSpec.describe "bundle lock" do DEPENDENCIES nokogiri + CHECKSUMS + #{checksum_for_repo_gem gem_repo4, "nokogiri", "1.12.0", "x86_64-darwin"} + BUNDLED WITH #{Bundler::VERSION} L @@ -590,6 +611,10 @@ RSpec.describe "bundle lock" do mixlib-shellout CHECKSUMS + #{checksum_for_repo_gem gem_repo4, "ffi", "1.9.14", "x86-mingw32"} + #{checksum_for_repo_gem gem_repo4, "gssapi", "1.2.0"} + #{checksum_for_repo_gem gem_repo4, "mixlib-shellout", "2.2.6", "universal-mingw32"} + #{checksum_for_repo_gem gem_repo4, "win32-process", "0.8.3"} BUNDLED WITH #{Bundler::VERSION} @@ -621,6 +646,12 @@ RSpec.describe "bundle lock" do mixlib-shellout CHECKSUMS + #{checksum_for_repo_gem gem_repo4, "ffi", "1.9.14"} + #{checksum_for_repo_gem gem_repo4, "ffi", "1.9.14", "x86-mingw32"} + #{checksum_for_repo_gem gem_repo4, "gssapi", "1.2.0"} + #{checksum_for_repo_gem gem_repo4, "mixlib-shellout", "2.2.6"} + #{checksum_for_repo_gem gem_repo4, "mixlib-shellout", "2.2.6", "universal-mingw32"} + #{checksum_for_repo_gem gem_repo4, "win32-process", "0.8.3"} BUNDLED WITH #{Bundler::VERSION} @@ -701,6 +732,8 @@ RSpec.describe "bundle lock" do libv8 CHECKSUMS + #{checksum_for_repo_gem gem_repo4, "libv8", "8.4.255.0", "x86_64-darwin-19"} + #{checksum_for_repo_gem gem_repo4, "libv8", "8.4.255.0", "x86_64-darwin-20"} BUNDLED WITH #{Bundler::VERSION} @@ -907,14 +940,114 @@ RSpec.describe "bundle lock" do it "does not implicitly update" do bundle "lock" - expect(read_lockfile).to eq(@lockfile) + expected_checksums = construct_checksum_section do |c| + c.repo_gem repo, "actionmailer", "2.3.2" + c.repo_gem repo, "actionpack", "2.3.2" + c.repo_gem repo, "activerecord", "2.3.2" + c.repo_gem repo, "activeresource", "2.3.2" + c.repo_gem repo, "activesupport", "2.3.2" + c.repo_gem repo, "foo", "1.0" + c.repo_gem repo, "rails", "2.3.2" + c.repo_gem repo, "rake", "13.0.1" + c.repo_gem repo, "weakling", "0.0.3" + end + + expected_lockfile = strip_lockfile(<<-L) + GEM + remote: #{file_uri_for(repo)}/ + specs: + actionmailer (2.3.2) + activesupport (= 2.3.2) + actionpack (2.3.2) + activesupport (= 2.3.2) + activerecord (2.3.2) + activesupport (= 2.3.2) + activeresource (2.3.2) + activesupport (= 2.3.2) + activesupport (2.3.2) + foo (1.0) + rails (2.3.2) + actionmailer (= 2.3.2) + actionpack (= 2.3.2) + activerecord (= 2.3.2) + activeresource (= 2.3.2) + rake (= 13.0.1) + rake (13.0.1) + weakling (0.0.3) + + PLATFORMS + #{lockfile_platforms} + + DEPENDENCIES + foo + rails + weakling + + CHECKSUMS + #{expected_checksums} + + BUNDLED WITH + #{Bundler::VERSION} + L + + expect(read_lockfile).to eq(expected_lockfile) end it "accounts for changes in the gemfile" do gemfile gemfile.gsub('"foo"', '"foo", "2.0"') bundle "lock" - expect(read_lockfile).to eq(@lockfile.sub("foo (1.0)", "foo (2.0)").sub(/foo$/, "foo (= 2.0)")) + expected_checksums = construct_checksum_section do |c| + c.repo_gem repo, "actionmailer", "2.3.2" + c.repo_gem repo, "actionpack", "2.3.2" + c.repo_gem repo, "activerecord", "2.3.2" + c.repo_gem repo, "activeresource", "2.3.2" + c.repo_gem repo, "activesupport", "2.3.2" + c.repo_gem repo, "foo", "2.0" + c.repo_gem repo, "rails", "2.3.2" + c.repo_gem repo, "rake", "13.0.1" + c.repo_gem repo, "weakling", "0.0.3" + end + + expected_lockfile = strip_lockfile(<<-L) + GEM + remote: #{file_uri_for(repo)}/ + specs: + actionmailer (2.3.2) + activesupport (= 2.3.2) + actionpack (2.3.2) + activesupport (= 2.3.2) + activerecord (2.3.2) + activesupport (= 2.3.2) + activeresource (2.3.2) + activesupport (= 2.3.2) + activesupport (2.3.2) + foo (2.0) + rails (2.3.2) + actionmailer (= 2.3.2) + actionpack (= 2.3.2) + activerecord (= 2.3.2) + activeresource (= 2.3.2) + rake (= 13.0.1) + rake (13.0.1) + weakling (0.0.3) + + PLATFORMS + #{lockfile_platforms} + + DEPENDENCIES + foo (= 2.0) + rails + weakling + + CHECKSUMS + #{expected_checksums} + + BUNDLED WITH + #{Bundler::VERSION} + L + + expect(read_lockfile).to eq(expected_lockfile) end end @@ -985,6 +1118,8 @@ RSpec.describe "bundle lock" do debug CHECKSUMS + #{checksum_for_repo_gem gem_repo4, "debug", "1.6.3"} + #{checksum_for_repo_gem gem_repo4, "irb", "1.5.0"} BUNDLED WITH #{Bundler::VERSION} diff --git a/spec/bundler/commands/update_spec.rb b/spec/bundler/commands/update_spec.rb index eb578d4dff..cf6a8d5be1 100644 --- a/spec/bundler/commands/update_spec.rb +++ b/spec/bundler/commands/update_spec.rb @@ -291,6 +291,8 @@ RSpec.describe "bundle update" do country_select CHECKSUMS + #{checksum_for_repo_gem(gem_repo4, "countries", "3.1.0")} + #{checksum_for_repo_gem(gem_repo4, "country_select", "5.1.0")} BUNDLED WITH #{Bundler::VERSION} @@ -560,6 +562,7 @@ RSpec.describe "bundle update" do activesupport (~> 6.0.0) CHECKSUMS + #{expected_checksums} BUNDLED WITH #{Bundler::VERSION} @@ -1282,7 +1285,7 @@ RSpec.describe "bundle update --bundler" do G lockfile lockfile.sub(/(^\s*)#{Bundler::VERSION}($)/, '\11.0.0\2') - excepted_checksum = checksum_for_repo_gem(gem_repo4, "rack", "1.0") + expected_checksum = checksum_for_repo_gem(gem_repo4, "rack", "1.0") FileUtils.rm_r gem_repo4 @@ -1302,7 +1305,7 @@ RSpec.describe "bundle update --bundler" do rack CHECKSUMS - #{excepted_checksum} + #{expected_checksum} BUNDLED WITH #{Bundler::VERSION} @@ -1714,6 +1717,14 @@ RSpec.describe "bundle update conservative" do it "should only change direct dependencies when updating the lockfile with --conservative" do bundle "lock --update --conservative" + expected_checksums = construct_checksum_section do |c| + c.repo_gem gem_repo4, "isolated_dep", "2.0.1" + c.repo_gem gem_repo4, "isolated_owner", "1.0.2" + c.repo_gem gem_repo4, "shared_dep", "5.0.1" + c.repo_gem gem_repo4, "shared_owner_a", "3.0.2" + c.repo_gem gem_repo4, "shared_owner_b", "4.0.2" + end + expect(lockfile).to eq <<~L GEM remote: #{file_uri_for(gem_repo4)}/ @@ -1736,6 +1747,7 @@ RSpec.describe "bundle update conservative" do shared_owner_b CHECKSUMS + #{expected_checksums} BUNDLED WITH #{Bundler::VERSION} |