Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bundler/cli/lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run
puts definition.to_lock
else
file = options[:lockfile]
file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile
file = file ? Pathname.new(file).expand_path : definition.lockfile

puts "Writing lockfile to #{file}"
definition.write_lock(file, false)
Expand Down
17 changes: 17 additions & 0 deletions spec/commands/lock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@
expect(read_lockfile).to eq(expected_lockfile)
end

it "writes the lockfile configured in the Gemfile" do
build_repo4 do
build_gem "foo", "1.0"
end

gemfile <<-G
source "https://gem.repo4"
gem "foo", "1.0"
lockfile "custom.lock"
G

bundle "lock"

expect(bundled_app("Gemfile.lock")).not_to exist
expect(bundled_app("custom.lock")).to exist
end

it "prints a lockfile without fetching new checksums if the existing lockfile had no checksums" do
gemfile_with_rails_weakling_and_foo_from_repo4

Expand Down
Loading