Skip to content
Newer
Older
100644 34 lines (25 sloc) 671 Bytes
5d88142 @zenspider ! Hot damn! It works with ruby_parser!!! (phiggins)
zenspider authored Oct 2, 2012
1 class MiniTestHeckler < Heckle
2 def initialize(class_or_module, method, options)
3 Dir.glob(options[:test_pattern]).each {|t| load File.expand_path(t) }
4
5 super(class_or_module, method, options[:nodes])
6 end
7
8 def tests_pass?
9 silence do
10 MiniTest::Unit.runner = nil
11
12 MiniTest::Unit.new.run
13
14 runner = MiniTest::Unit.runner
15
16 runner.failures == 0 && runner.errors == 0
17 end
18 end
19
20 # TODO: Windows.
21 def silence
22 return yield if Heckle.debug
23
24 begin
25 original = MiniTest::Unit.output
26 MiniTest::Unit.output = File.open("/dev/null", "w")
27
28 yield
29 ensure
30 MiniTest::Unit.output = original
31 end
32 end
33 end
Something went wrong with that request. Please try again.