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:
parent
c1f6f2c9e7
commit
abf0d96b60
2 changed files with 5 additions and 8 deletions
|
@ -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?
|
||||
|
|
|
@ -55,6 +55,10 @@ module Tests
|
|||
end
|
||||
end
|
||||
|
||||
def version
|
||||
Bundler::VERSION
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
attr_reader :fs
|
||||
|
|
Loading…
Reference in a new issue