diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/bundler/bundler/lockfile_parser_spec.rb | 21 | ||||
| -rw-r--r-- | spec/bundler/quality_spec.rb | 2 | ||||
| -rw-r--r-- | spec/bundler/realworld/fixtures/warbler/Gemfile | 2 | ||||
| -rw-r--r-- | spec/bundler/realworld/fixtures/warbler/Gemfile.lock | 26 |
4 files changed, 34 insertions, 17 deletions
diff --git a/spec/bundler/bundler/lockfile_parser_spec.rb b/spec/bundler/bundler/lockfile_parser_spec.rb index 4b493a3757..7364ab98e5 100644 --- a/spec/bundler/bundler/lockfile_parser_spec.rb +++ b/spec/bundler/bundler/lockfile_parser_spec.rb @@ -252,6 +252,27 @@ RSpec.describe Bundler::LockfileParser do end end + context "when lockfile_path is given" do + it "uses the provided path in error messages instead of looking up Bundler.default_lockfile" do + expect(Bundler::SharedHelpers).not_to receive(:relative_lockfile_path) + parser = described_class.new(lockfile_contents, lockfile_path: "custom/path.lock") + expect(parser.valid?).to be(true) + rake_spec = parser.specs.last + checksums = parser.sources.last.checksum_store.to_lock(rake_spec) + expected_checksum = Bundler::Checksum.from_lock( + "sha256=814828c34f1315d7e7b7e8295184577cc4e969bad6156ac069d02d63f58d82e8", + "custom/path.lock:20:17" + ) + expect(checksums).to eq("#{rake_spec.lock_name} #{expected_checksum.to_lock}") + end + + it "raises with the provided path when the lockfile contains merge conflicts" do + expect do + described_class.new("<<<<<<<\n", lockfile_path: "custom/path.lock") + end.to raise_error(Bundler::LockfileError, %r{custom/path\.lock contains merge conflicts}) + end + end + context "when CHECKSUMS has duplicate checksums in the lockfile that don't match" do let(:bad_checksum) { "sha256=c0ffee11c0ffee11c0ffee11c0ffee11c0ffee11c0ffee11c0ffee11c0ffee11" } let(:lockfile_contents) { super().split(/(?<=CHECKSUMS\n)/m).insert(1, " rake (10.3.2) #{bad_checksum}\n").join } diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb index 33ae503a5a..16b7f18788 100644 --- a/spec/bundler/quality_spec.rb +++ b/spec/bundler/quality_spec.rb @@ -109,7 +109,7 @@ RSpec.describe "The library itself" do it "does not include any unresolved merge conflicts" do error_messages = [] - exempt = %r{lock/lockfile_spec|quality_spec|vcr_cassettes|\.ronn|lockfile_parser\.rb} + exempt = %r{lock/lockfile_spec|quality_spec|vcr_cassettes|\.ronn|lockfile_parser} tracked_files.each do |filename| next if filename&.match?(exempt) error_messages << check_for_git_merge_conflicts(filename) diff --git a/spec/bundler/realworld/fixtures/warbler/Gemfile b/spec/bundler/realworld/fixtures/warbler/Gemfile index 07dc301d03..5687bbd975 100644 --- a/spec/bundler/realworld/fixtures/warbler/Gemfile +++ b/spec/bundler/realworld/fixtures/warbler/Gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "demo", path: "./demo" gem "jruby-jars", "~> 10.0" -gem "warbler", github: "https://github.com/jruby/warbler/pull/557" +gem "warbler", "~> 2.1" diff --git a/spec/bundler/realworld/fixtures/warbler/Gemfile.lock b/spec/bundler/realworld/fixtures/warbler/Gemfile.lock index 2f2deea994..05f3bc4e3f 100644 --- a/spec/bundler/realworld/fixtures/warbler/Gemfile.lock +++ b/spec/bundler/realworld/fixtures/warbler/Gemfile.lock @@ -1,15 +1,3 @@ -GIT - remote: https://github.com/jruby/warbler.git - revision: 3a3a89e9a055ab1badb4e6fee860e8617b4acfe1 - ref: refs/pull/557/head - specs: - warbler (2.0.5) - jruby-jars (>= 9.0.0) - jruby-rack (>= 1.1.1, < 1.3) - rake (>= 13.0.3) - rexml (~> 3.0) - rubyzip (>= 1.0.0) - PATH remote: demo specs: @@ -19,10 +7,18 @@ GEM remote: https://rubygems.org/ specs: jruby-jars (10.0.0.1) - jruby-rack (1.2.2) + jruby-rack (1.2.7) + ostruct (0.6.3) rake (13.3.0) rexml (3.4.2) - rubyzip (2.4.1) + rubyzip (3.3.0) + warbler (2.1.0) + jruby-jars (>= 9.4, < 10.1) + jruby-rack (>= 1.2.3, < 1.3) + ostruct (~> 0.6.2) + rake (~> 13.0, >= 13.0.3) + rexml (~> 3.0) + rubyzip (>= 3.0.0) PLATFORMS arm64-darwin @@ -33,7 +29,7 @@ PLATFORMS DEPENDENCIES demo! jruby-jars (~> 10.0) - warbler! + warbler (~> 2.1) BUNDLED WITH 4.1.0.dev |
