class MicroTest::TestCase

Private Class Methods

inherited(subclass) click to toggle source

When the TestCase class is inherited, a new instance is automatically created.

# File lib/microtest.rb, line 29
def self.inherited(subclass)
  subclass.new
end
new(*a,&b) click to toggle source

Create a new test and add it the the $TEST_SUITE global variable.

Calls superclass method
# File lib/microtest.rb, line 36
def self.new(*a,&b)
  $TEST_SUITE << super(*a,&b)
end

Private Instance Methods

call(&cont) click to toggle source

Wrap test case run.

@todo: Support setup-all and teardown-all in future ?

# File lib/microtest.rb, line 52
def call(&cont)
  #setup_all
  cont.call
  #teardown_all
end
each() { |test_method(self, method(m))| ... } click to toggle source

Iterate over each test.

# File lib/microtest.rb, line 61
def each
  methods.each do |m|
    next unless m.to_s.start_with?('test_')
    yield(TestMethod.new(self, method(m)))
  end
end
setup() click to toggle source

No-op for test setup routine.

# File lib/microtest.rb, line 71
def setup
end
teardown() click to toggle source

No-op for test teardown routine.

# File lib/microtest.rb, line 77
def teardown
end
to_s() click to toggle source

Returns name of testcase class.

# File lib/microtest.rb, line 43
def to_s
  self.class.name
end