Class: RUNIT::TestCase

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
Assert
Defined in:
lib/runit/testcase.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Assert

#assert_equal_float, #assert_exception, #assert_fail, #assert_match, #assert_matches, #assert_no_exception, #assert_not_match, #assert_not_nil, #assert_respond_to, #assert_send, #called_internally?, #setup_assert

Constructor Details

#initialize(test_name, suite_name = self.class.name) ⇒ TestCase

Returns a new instance of TestCase.


28
29
30
# File 'lib/runit/testcase.rb', line 28

def initialize(test_name, suite_name=self.class.name)
  super(test_name)
end

Class Method Details

.suiteObject


15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/runit/testcase.rb', line 15

def self.suite
  method_names = instance_methods(true)
  tests = method_names.delete_if { |method_name| method_name !~ /^test/ }
  suite = TestSuite.new(name)
  tests.each {
    |test|
    catch(:invalid_test) {
      suite << new(test, name)
    }
  }
  return suite
end

Instance Method Details

#assert_equals(*args) ⇒ Object


32
33
34
# File 'lib/runit/testcase.rb', line 32

def assert_equals(*args)
  assert_equal(*args)
end

#nameObject


36
37
38
# File 'lib/runit/testcase.rb', line 36

def name
  super.sub(/^(.*?)\((.*)\)$/, '\2#\1')
end

#run(result, &progress_block) ⇒ Object


40
41
42
43
# File 'lib/runit/testcase.rb', line 40

def run(result, &progress_block)
  progress_block = proc {} unless (block_given?)
  super(result, &progress_block)
end