Skip to content

Commit

Permalink
Fix Travis build (#134)
Browse files Browse the repository at this point in the history
* Check if appraisal install produces the same result with bundle install
* pin version of rake gem for Ruby Gems lower than 1.8 for the spec `bundle_with_custom_path_spec.rb`
  • Loading branch information
berkos authored and nickcharlton committed Jan 20, 2018
1 parent 2f4d068 commit a00e81c
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions spec/acceptance/bundle_with_custom_path_spec.rb
Original file line number Diff line number Diff line change
@@ -1,38 +1,10 @@
require "spec_helper"

describe "Bundle with custom path" do
it "supports --path option" do
build_gemfile <<-Gemfile
source "https://rubygems.org"
let(:gem_name) { 'rack' }
let(:path) { 'vendor/bundle' }

gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
Gemfile

build_appraisal_file <<-Appraisals
appraise "breakfast" do
end
Appraisals

run %(bundle install --path="vendor/bundle")
output = run "appraisal install"

expect(file "gemfiles/breakfast.gemfile").to be_exists
expect(output).to include("Successfully installed bundler")
end

context 'when already installed in vendor/another' do
let(:gem_name) { 'rack' }
let(:path) { 'vendor/bundle' }

before do
build_gemfile <<-Gemfile
source "https://rubygems.org"
gem '#{gem_name}'
Gemfile

run 'bundle install --path vendor/another'
end
shared_examples :gemfile_dependencies_are_satisfied do

it 'installs gems in the --path directory' do
build_gemfile <<-Gemfile
Expand Down Expand Up @@ -68,4 +40,24 @@
expect(appraisal_output).to include("The Gemfile's dependencies are satisfied")
end
end

include_examples :gemfile_dependencies_are_satisfied

context 'when already installed in vendor/another' do
before do
build_gemfile <<-Gemfile
source "https://rubygems.org"
if RUBY_VERSION <= "1.9"
gem '#{gem_name}', '~> 1.6.5'
else
gem '#{gem_name}'
end
Gemfile

run 'bundle install --path vendor/another'
end

include_examples :gemfile_dependencies_are_satisfied
end
end

0 comments on commit a00e81c

Please sign in to comment.