summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2025-11-08 16:00:57 -0800
committergit <svn-admin@ruby-lang.org>2025-11-20 23:01:02 +0000
commit82d8d24e7cdd26123ed4ad478ce6a0bb81d7abb5 (patch)
tree1977009010f48496ab30012f03f3567776d18d9a /spec
parentfb28d4748dc96d581592b0d4c186ca0a8d49fa26 (diff)
[ruby/rubygems] Add support for lockfile in Gemfile
This allows you to specify the lockfile to use. This is useful if you want to use different lockfiles for different ruby versions or platforms. You can also skip writing the lockfile by using a false value. https://github.com/ruby/rubygems/commit/2896aa3fc2 Co-authored-by: Colby Swandale <996377+colby-swandale@users.noreply.github.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/install_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/bundler/commands/install_spec.rb b/spec/bundler/commands/install_spec.rb
index 0dbe950f87..68232d92de 100644
--- a/spec/bundler/commands/install_spec.rb
+++ b/spec/bundler/commands/install_spec.rb
@@ -29,6 +29,28 @@ RSpec.describe "bundle install with gem sources" do
expect(bundled_app_lock).to exist
end
+ it "creates lockfile based on the lockfile method in Gemfile" do
+ install_gemfile <<-G
+ lockfile "OmgFile.lock"
+ source "https://gem.repo1"
+ gem "myrack", "1.0"
+ G
+
+ bundle "install"
+
+ expect(bundled_app("OmgFile.lock")).to exist
+ end
+
+ it "does not make a lockfile if lockfile false is used in Gemfile" do
+ install_gemfile <<-G
+ lockfile false
+ source "https://gem.repo1"
+ gem 'myrack'
+ G
+
+ expect(bundled_app_lock).not_to exist
+ end
+
it "does not create ./.bundle by default" do
install_gemfile <<-G
source "https://gem.repo1"