Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure that we run `bundle exec` on the commands so it would solve…

… gem conflict.
  • Loading branch information...
commit 124a9511d2f4c892fe5e7c6c169cc57544506472 1 parent dd23fe0
@sikachu sikachu authored
Showing with 15 additions and 9 deletions.
  1. +9 −8 features/appraisals.feature
  2. +6 −1 lib/appraisal/command.rb
View
17 features/appraisals.feature
@@ -6,7 +6,7 @@ Feature: run a rake task through several appraisals
And I write to "Gemfile" with:
"""
source "http://rubygems.org"
- gem "rake"
+ gem "rake", "0.8.7"
gem "factory_girl"
"""
When I add "appraisal" from this project as a dependency
@@ -17,6 +17,7 @@ Feature: run a rake task through several appraisals
end
appraise "1.3.0" do
gem "factory_girl", "1.3.0"
+ gem "rake", "0.9.0"
end
"""
When I write to "Rakefile" with:
@@ -35,40 +36,40 @@ Feature: run a rake task through several appraisals
end
task :default => :version
"""
- When I successfully run "rake appraisal:install --trace"
+ When I successfully run "bundle exec rake appraisal:install --trace"
@disable-bundler
Scenario: run a specific task with one appraisal
- When I successfully run "rake appraisal:1.3.0 version --trace"
+ When I successfully run "bundle exec rake appraisal:1.3.0 version --trace"
Then the output should contain "Loaded 1.3.0"
@disable-bundler
Scenario: run a specific task with all appraisals
- When I successfully run "rake appraisal version --trace"
+ When I successfully run "bundle exec rake appraisal version --trace"
Then the output should contain "Loaded 1.3.0"
And the output should contain "Loaded 1.3.2"
And the output should not contain "Invoke version"
@disable-bundler
Scenario: run the default task with one appraisal
- When I successfully run "rake appraisal:1.3.0 --trace"
+ When I successfully run "bundle exec rake appraisal:1.3.0 --trace"
Then the output should contain "Loaded 1.3.0"
@disable-bundler
Scenario: run the default task with all appraisals
- When I successfully run "rake appraisal --trace"
+ When I successfully run "bundle exec rake appraisal --trace"
Then the output should contain "Loaded 1.3.0"
And the output should contain "Loaded 1.3.2"
@disable-bundler
Scenario: run a failing task with one appraisal
- When I run "rake appraisal:1.3.0 fail --trace"
+ When I run "bundle exec rake appraisal:1.3.0 fail --trace"
Then the output should contain "Fail 1.3.0"
And the exit status should be 1
@disable-bundler
Scenario: run a failing task with all appraisals
- When I run "rake appraisal fail --trace"
+ When I run "bundle exec rake appraisal fail --trace"
Then the output should contain "Fail 1.3.2"
But the output should not contain "Fail 1.3.0"
And the exit status should be 1
View
7 lib/appraisal/command.rb
@@ -11,12 +11,17 @@ def self.from_args(gemfile)
def initialize(command, gemfile = nil)
@original_env = {}
@gemfile = gemfile
- @command = command
+ if command =~ /^bundle/
+ @command = command
+ else
+ @command = "bundle exec #{command}"
+ end
end
def run
announce
with_clean_env do
+ puts @command
unless Kernel.system(@command)
exit(1)
end
Please sign in to comment.
Something went wrong with that request. Please try again.