aboutsummaryrefslogtreecommitdiffstats
path: root/spec/commands
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-06-05 16:42:47 +0800
committerAndre Arko <andre@arko.net>2015-06-08 00:32:21 -0700
commitab41652a553443da83974ca2753852199a63913c (patch)
tree64e4bc3c42b37205f102de8b35c7c114a8f79131 /spec/commands
parent00ca9ae0800b61316e973af46e03e8c7d3a0fd07 (diff)
downloadbundler-ab41652a553443da83974ca2753852199a63913c.tar.gz
failing specs for BUNDLED WITH preservation
we want to avoid changing the lock just to add BUNDLED WITH unless the user is explicitly running a Bundler command; implicit locking should not alter the lockfile.
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/check_spec.rb55
1 files changed, 55 insertions, 0 deletions
diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb
index 6d047597..0213f4b7 100644
--- a/spec/commands/check_spec.rb
+++ b/spec/commands/check_spec.rb
@@ -275,4 +275,59 @@ describe "bundle check" do
expect(out).to include("* rack (1.0")
end
end
+
+ describe "BUNDLED WITH" do
+ def lock_with(bundler_version = nil)
+ lock = <<-L
+ GEM
+ remote: file:#{gem_repo1}/
+ specs:
+ rack (1.0.0)
+
+ PLATFORMS
+ #{generic(Gem::Platform.local)}
+
+ DEPENDENCIES
+ rack
+ L
+
+ if bundler_version
+ lock << "\n BUNDLED WITH\n #{bundler_version}\n"
+ end
+
+ lock
+ end
+
+ before do
+ install_gemfile <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+ end
+
+ context "is not present" do
+ it "does not change the lock" do
+ lockfile lock_with(nil)
+ bundle :check
+ lockfile_should_be lock_with(nil)
+ end
+ end
+
+ context "is newer" do
+ it "does not change the lock" do
+ lockfile lock_with(Bundler::VERSION.succ)
+ bundle :check
+ lockfile_should_be lock_with(Bundler::VERSION.succ)
+ end
+ end
+
+ context "is older" do
+ it "does not change the lock" do
+ lockfile lock_with("1.10.1")
+ bundle :check
+ lockfile_should_be lock_with("1.10.1")
+ end
+ end
+ end
+
end