diff --git a/lib/appraisal/appraisal.rb b/lib/appraisal/appraisal.rb index 657202ca..a59f5c54 100644 --- a/lib/appraisal/appraisal.rb +++ b/lib/appraisal/appraisal.rb @@ -37,7 +37,8 @@ def gemfile_path end def bundle_command - "bundle install --gemfile='#{gemfile_path}'" + gemfile = "--gemfile='#{gemfile_path}'" + "bundle check #{gemfile} || bundle install #{gemfile}" end private diff --git a/spec/appraisal/appraisal_spec.rb b/spec/appraisal/appraisal_spec.rb index 2f2e05de..07d751f6 100644 --- a/spec/appraisal/appraisal_spec.rb +++ b/spec/appraisal/appraisal_spec.rb @@ -6,7 +6,7 @@ appraisal = Appraisal::Appraisal.new('fake', 'fake') appraisal.stub(:gemfile_path).and_return("/home/test/test directory") - appraisal.bundle_command.should == "bundle install --gemfile='/home/test/test directory'" + appraisal.bundle_command.should == "bundle check --gemfile='/home/test/test directory' || bundle install --gemfile='/home/test/test directory'" end it "cleans up spaces and punctuation when outputting its gemfile" do