class MiniTestHeckler

Public Instance Methods

silence() { || ... } click to toggle source

TODO: Windows.

# File lib/minitest_heckler.rb, line 21
def silence
  return yield if Heckle.debug

  begin
    original = MiniTest::Unit.output
    MiniTest::Unit.output = File.open("/dev/null", "w")

    yield
  ensure
    MiniTest::Unit.output = original
  end
end
tests_pass?() click to toggle source
# File lib/minitest_heckler.rb, line 8
def tests_pass?
  silence do
    MiniTest::Unit.runner = nil

    MiniTest::Unit.new.run

    runner = MiniTest::Unit.runner

    runner.failures == 0 && runner.errors == 0
  end
end

Public Class Methods

new(class_or_module, method, options) click to toggle source
# File lib/minitest_heckler.rb, line 2
def initialize(class_or_module, method, options)
  Dir.glob(options[:test_pattern]).each {|t| load File.expand_path(t) }

  super(class_or_module, method, options[:nodes])
end