summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wen <jrw2175@columbia.edu>2016-01-06 23:53:52 -0500
committerJames Wen <jrw2175@columbia.edu>2016-01-08 01:08:57 -0500
commit59e90bd7ec2608661b447aa4952584ce3eda28ee (patch)
tree80cc1c2f0836d7ce9a332f5cd66b63de1df7cd40
parent89399b799f09b83170d84320443608043e106d75 (diff)
downloadbundler-59e90bd7ec2608661b447aa4952584ce3eda28ee.tar.gz
Add unit tests for `Bundler::SharedHelpers#default_lockfile`
-rw-r--r--spec/bundler/shared_helpers_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb
index 4803c66977..da11fa1f09 100644
--- a/spec/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/shared_helpers_spec.rb
@@ -22,6 +22,30 @@ describe Bundler::SharedHelpers do
end
end
end
+ describe "#default_lockfile" do
+ subject { Bundler::SharedHelpers.default_lockfile }
+
+ context "gemfile is gems.rb" do
+ before do
+ gemfile_path = Pathname.new("/path/gems.rb")
+ allow(Bundler::SharedHelpers).to receive(:default_gemfile).and_return(gemfile_path)
+ end
+ it "returns the gems.locked path" do
+ expected_lockfile_path = Pathname.new("/path/gems.locked")
+ expect(subject).to eq(expected_lockfile_path)
+ end
+ end
+ context "is a regular Gemfile" do
+ before do
+ gemfile_path = Pathname.new("/path/Gemfile")
+ allow(Bundler::SharedHelpers).to receive(:default_gemfile).and_return(gemfile_path)
+ end
+ it "returns the lock file path" do
+ expected_lockfile_path = Pathname.new("/path/Gemfile.lock")
+ expect(subject).to eq(expected_lockfile_path)
+ end
+ end
+ end
describe "#const_get_safely" do
module TargetNamespace
VALID_CONSTANT = 1