lib/micron/runner.rb in micron-0.5.0 vs lib/micron/runner.rb in micron-0.5.1
- old
+ new
@@ -22,16 +22,17 @@
# these exceptions, if caught while running, will be re-raised
PASSTHROUGH_EXCEPTIONS = [
NoMemoryError, SignalException, Interrupt, SystemExit
]
- attr_reader :results
+ attr_reader :results, :reporters, :files
- def initialize(files, reporters)
- @files = files
- @results = []
- @reporters = reporters || []
+ def initialize(files, method_patterns, reporters)
+ @files = files
+ @method_patterns = method_patterns || []
+ @reporters = reporters || []
+ @results = []
@mutex = Mutex.new
if self.class.to_s != "Micron::Runner" then
# Only needed in fork/proc runners
@@ -44,11 +45,11 @@
def run
report(:start_tests, @files)
@files.each do |file|
- test_file = TestFile.new(file)
+ test_file = TestFile.new(file, @method_patterns)
report(:start_file, test_file)
begin
test_file.load(true)
results = test_file.run(Clazz)
@@ -56,12 +57,12 @@
results = [ex]
end
results.each do |clazz|
if clazz.kind_of? Exception then
- puts "Error loading test file: #{file}"
- puts clazz
- puts clazz.backtrace
+ STDERR.puts "Error loading test file: #{file}"
+ STDERR.puts clazz
+ STDERR.puts clazz.backtrace
exit 1
end
# should be a Clazz
@results << clazz