class MooMooTest

Constants

TESTS

Attributes

failure[RW]
failure?[RW]
name[RW]

Public Class Methods

inherited(x) click to toggle source
# File lib/moomootest.rb, line 67
def self.inherited x
  TESTS << x
end
new(name) click to toggle source
# File lib/moomootest.rb, line 62
def initialize name
  self.name = name
  self.failure = false
end
run(reporter) click to toggle source
# File lib/moomootest.rb, line 85
def self.run reporter
  test_names.shuffle.each do |name|
    reporter << self.new(name).run
  end
end
run_all_tests() click to toggle source
# File lib/moomootest.rb, line 71
def self.run_all_tests
  reporter = Reporter.new

  TESTS.each do |klass|
    klass.run reporter
  end
  
  reporter.summary
end
test_names() click to toggle source
# File lib/moomootest.rb, line 81
def self.test_names
  public_instance_methods.grep(/^test_/)
end

Public Instance Methods

run() click to toggle source
# File lib/moomootest.rb, line 91
def run
  send name
rescue => e
  self.failure = e
ensure
  return self
end