spec/appraisal/appraisal_spec.rb in appraisal-2.2.0 vs spec/appraisal/appraisal_spec.rb in appraisal-2.3.0
- old
+ new
@@ -32,10 +32,12 @@
include StreamHelpers
before do
@appraisal = Appraisal::Appraisal.new('fake', 'fake')
allow(@appraisal).to receive(:gemfile_path).and_return("/home/test/test directory")
+ allow(@appraisal).to receive(:project_root).
+ and_return(Pathname.new("/home/test"))
allow(Appraisal::Command).to receive(:new).and_return(double(:run => true))
end
it 'runs single install command on Bundler < 1.4.0' do
stub_const('Bundler::VERSION', '1.3.0')
@@ -63,10 +65,17 @@
expect(Appraisal::Command).to have_received(:new).
with("#{bundle_check_command} || #{bundle_install_command_with_retries}")
end
+ it "runs install command with path on Bundler" do
+ @appraisal.install("path" => "vendor/appraisal")
+
+ expect(Appraisal::Command).to have_received(:new).
+ with("#{bundle_check_command} || #{bundle_install_command_with_path}")
+ end
+
def bundle_check_command
"bundle check --gemfile='/home/test/test directory'"
end
def bundle_single_install_command
@@ -77,8 +86,13 @@
"bundle install --gemfile='/home/test/test directory' --jobs=42"
end
def bundle_install_command_with_retries
"bundle install --gemfile='/home/test/test directory' --retry 3"
+ end
+
+ def bundle_install_command_with_path
+ "bundle install --gemfile='/home/test/test directory' " \
+ "--path /home/test/vendor/appraisal"
end
end
end