summaryrefslogtreecommitdiff
path: root/spec/bundler/commands/lock_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/commands/lock_spec.rb')
-rw-r--r--spec/bundler/commands/lock_spec.rb139
1 files changed, 137 insertions, 2 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}