diff options
author | Kevin Moore <kevin@thinkpixellab.com> | 2010-05-22 21:58:47 -0700 |
---|---|---|
committer | Kevin Moore <kevin@thinkpixellab.com> | 2010-05-24 00:29:31 -0500 |
commit | 36878435b5f0be75fc6f2e07cebd7f15aaddadf0 (patch) | |
tree | 51e796a9a3a04b2283dca9abbc7e6930f5fdf149 /spec/other/check_spec.rb | |
parent | a388b0e181f5a094e4e864da94a06c90931a50a7 (diff) | |
download | bundler-36878435b5f0be75fc6f2e07cebd7f15aaddadf0.tar.gz |
check only needs Environment (not Runtime)
Benefit 1) check doesn't change local file contents via loading Runtime
Benefit 2) Get an actual good output for check returning not-found errors
lock_contents can raise an exception. Should not open file until content is generated without error
More clear about what is being checked for in out.should
Test of 3x check causing error on last run
Multiple calls to check should give the same output
Diffstat (limited to 'spec/other/check_spec.rb')
-rw-r--r-- | spec/other/check_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/other/check_spec.rb b/spec/other/check_spec.rb index 6f5079a0..165c5979 100644 --- a/spec/other/check_spec.rb +++ b/spec/other/check_spec.rb @@ -92,6 +92,34 @@ describe "bundle check" do out.should include("Could not locate Gemfile") end + it "should not crash when called multiple times on a new machine" do + gemfile <<-G + gem 'rails', '3.0.0.beta3' + gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git' + G + + simulate_new_machine + bundle :check + @err.should == "" + bundle :check + @err.should == "" + bundle :check + @err.should == "" + end + + it "should return the same result when called multiple times on a new machine" do + gemfile <<-G + gem 'rails', '3.0.0.beta3' + gem 'haml' + G + + simulate_new_machine + bundle :check + last_out = @out + bundle :check + @out.should == last_out + end + describe "when locked" do before :each do system_gems "rack-1.0.0" @@ -111,6 +139,7 @@ describe "bundle check" do it "shows what is missing with the current Gemfile if it is not satisfied" do simulate_new_machine bundle :check + should be_true out.start_with?("The following dependencies are missing") out.should include("rack (= 1.0") end end |