Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exit with negative exit code on problems.
- Switch to test/spec - Add .autotest recipe - exit with -1 if a command fails
- Loading branch information
Showing
7 changed files
with
82 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Autotest.add_hook :initialize do |at| | ||
at.unit_diff = 'cat' | ||
at.failed_results_re = /^\s+\d+\) (?:Failure|Error):\n(.*?)\((.*?)\)\n\[([^:]*):.*\]/ | ||
|
||
at.add_exception %r%^\./(?:db|doc|log|public|script|tmp|vendor|data|content|config)% | ||
at.add_exception %r%\.svn% | ||
|
||
at.clear_mappings | ||
|
||
at.add_mapping %r%^lib/(.*)\.rb% do |_, match| | ||
sqwat = match[1].gsub('/', '_') | ||
"test/#{sqwat}_spec.rb" | ||
end | ||
|
||
at.add_mapping %r%^test/.*_spec\.rb$% do |filename, _| | ||
filename | ||
end | ||
|
||
class << at | ||
def consolidate_failures(failed) | ||
failed.inject(new_hash_of_arrays) do |filters, (method, klass, filename)| | ||
filters[File.expand_path(filename)] << method; filters | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Hail | ||
class Workbench | ||
def self.init(options={}) | ||
true | ||
end | ||
end | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
require 'rubygems' rescue LoadError | ||
|
||
require 'bacon' | ||
require 'test/spec' | ||
require 'mocha' | ||
|
||
$:.unshift(File.expand_path('../lib', __FILE__)) | ||
|
||
require 'receptor' | ||
|
||
module StdOutReceptor | ||
def capturing_stdout | ||
original_stdout = $stdout | ||
$stdout = Receptor.instance | ||
yield | ||
ensure | ||
$stdout = original_stdout | ||
end | ||
|
||
def stdout_lines | ||
Receptor.instance.message.map { |call| call[1] } | ||
end | ||
end | ||
|
||
$:.unshift(File.expand_path('../../lib', __FILE__)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module StdOutReceptor | ||
def capturing_stdout | ||
original_stdout = $stdout | ||
$stdout = Receptor.instance | ||
yield | ||
ensure | ||
$stdout = original_stdout | ||
end | ||
|
||
def stdout_lines | ||
Receptor.instance.message.map { |call| call[1] } | ||
end | ||
end |