1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

Ensure that the correct Bundler is used to run acceptance tests

This commit is contained in:
Elliot Winkler 2019-03-20 22:39:10 -07:00
parent c1f6f2c9e7
commit abf0d96b60
2 changed files with 5 additions and 8 deletions

View file

@ -39,14 +39,7 @@ module AcceptanceTests
def run_command_within_bundle(*args)
run_command_isolated_from_bundle(*args) do |runner|
bundler_version = `bundle -v`.sub(/Bundler version /, '')
if bundler_version !~ /^1\./
puts 'Installing Bundler 1.x...'
system('gem', 'install', 'bundler', '-v', '~> 1')
end
runner.command_prefix = 'bundle exec'
runner.command_prefix = "bundle _#{bundle.version}_ exec"
runner.env['BUNDLE_GEMFILE'] = fs.find_in_project('Gemfile').to_s
yield runner if block_given?

View file

@ -55,6 +55,10 @@ module Tests
end
end
def version
Bundler::VERSION
end
protected
attr_reader :fs