Class: GUnit::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/gunit/test_suite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestSuite

Returns a new instance of TestSuite.



8
9
# File 'lib/gunit/test_suite.rb', line 8

def initialize()
end

Instance Attribute Details

#testsObject



11
12
13
# File 'lib/gunit/test_suite.rb', line 11

def tests
  @tests ||= []
end

Instance Method Details

#run(&blk) ⇒ Object



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

def run(&blk)
  self.tests.each do |test|
    case
    when test.is_a?(TestSuite)
      test.run{|response| blk.call(response) if blk }
    when test.is_a?(TestCase)
      response = test.run
      blk.call(response) if blk
    end
  end
end