summaryrefslogtreecommitdiff
path: root/spec/install
diff options
context:
space:
mode:
authorAndre Arko and Terence Lee <andre.arko+terence.lee@gmail.com>2011-03-15 17:45:30 -0700
committerAndre Arko and Terence Lee <andre.arko+terence.lee@gmail.com>2011-03-15 17:46:59 -0700
commit3d88ab9e3dab9c524c0f1b5561af2cbb92ac791a (patch)
tree821d0446d749c76d8754a5561da91e237bd2287a /spec/install
parent48758f945d19628ce4b480080f120449395d9e5f (diff)
downloadbundler-gemfile_hashing.tar.gz
Add tests for Gemfile hashing, fix hashing logicgemfile_hashing
Diffstat (limited to 'spec/install')
-rw-r--r--spec/install/gems/resolving_spec.rb31
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb
index 67b9b2f928..ee512a979c 100644
--- a/spec/install/gems/resolving_spec.rb
+++ b/spec/install/gems/resolving_spec.rb
@@ -69,4 +69,33 @@ describe "bundle install with gem sources" do
end
end
end
-end \ No newline at end of file
+
+ context "Gemfile hashing" do
+ before do
+ build_lib('foo')
+ install_gemfile <<-G, :expect_err => true
+ source "file://#{gem_repo1}"
+ gem "foo", :path => "#{lib_path('foo-1.0')}"
+ G
+ end
+
+ it "when Gemfile changes it reruns the resolver" do
+ install_gemfile <<-G, :expect_err => true, :env => {"DEBUG_RESOLVER" => true }
+ gem "foo", :path => "#{lib_path('foo-1.0')}"
+ G
+ err.should_not == ""
+ end
+
+ it "if the Gemfile has not changed don't rerun the resolver" do
+ bundle :install, :env => {"DEBUG_RESOLVER" => true }
+ err.should == ""
+ end
+
+ it "if the Gemfile.lock does not exist, generate one" do
+ bundled_app('Gemfile.lock').rmtree
+
+ bundle :install, :expect_err => true, :env => {"DEBUG_RESOLVER" => true }
+ err.should_not == ""
+ end
+ end
+end