Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #36 from customink/abort_removal
Browse files Browse the repository at this point in the history
Remove the abort call and return true/false in run!
  • Loading branch information
Seth Vargo committed Aug 8, 2013
2 parents 73cdf74 + 08c5fc5 commit b9c776c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion lib/strainer/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def initialize(*args)
desc 'test [COOKBOOKS]', 'Run tests against the given cookbooks'
def test(*cookbooks)
Strainer.ui.debug "Called Strainer::Cli#test with #{cookbooks.inspect}"
Strainer::Runner.new(cookbooks, options).run!
ret = Strainer::Runner.new(cookbooks, options).run!
exit(ret)
end

# strainer info
Expand Down
15 changes: 7 additions & 8 deletions lib/strainer/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run!
if options[:fail_fast] && !success
Strainer.ui.debug "Run was not successful and --fail-fast was specified"
Strainer.ui.fatal "Exited early because '--fail-fast' was specified. Some tests may have been skipped!"
abort
return false
end
end
end
Expand All @@ -69,13 +69,12 @@ def run!
FileUtils.mv(Strainer.logfile_path, Strainer.sandbox_path.join('strainer.out'))
end

if @report.values.collect(&:values).flatten.all?
Strainer.ui.say "Strainer marked build OK"
exit(true)
else
Strainer.ui.say "Strainer marked build as failure"
exit(false)
end
success = @report.values.collect(&:values).flatten.all?

msg = success ? "Strainer marked build OK" : "Strainer marked build as failure"
Strainer.ui.say msg

return success
end

def hash
Expand Down

0 comments on commit b9c776c

Please sign in to comment.