Permalink
Browse files

Exit with error when one appraisal fails

  • Loading branch information...
1 parent ff75e90 commit dcd72feead64ef7b158bd4dc929a100a64682a90 @jferris jferris committed Nov 11, 2010
Showing with 23 additions and 1 deletion.
  1. +18 −0 features/appraisals.feature
  2. +5 −1 lib/appraisal/command.rb
@@ -28,6 +28,11 @@ Feature: run a rake task through several appraisals
require 'factory_girl'
puts "Loaded #{Factory::VERSION}"
end
+ task :fail do
+ require 'factory_girl'
+ puts "Fail #{Factory::VERSION}"
+ raise
+ end
task :default => :version
"""
When I successfully run "rake appraisal:install --trace"
@@ -55,3 +60,16 @@ Feature: run a rake task through several appraisals
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"
+ 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"
+ 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
@@ -16,7 +16,11 @@ def initialize(command, gemfile = nil)
def run
announce
- with_clean_env { Kernel.system(@command) }
+ with_clean_env do
+ unless Kernel.system(@command)
+ exit(1)
+ end
+ end
end
def exec

0 comments on commit dcd72fe

Please sign in to comment.