class TestSuiteModelItem

# ———————————————————————- A collection of tests.

Public Class Methods

new(model, path) click to toggle source
Calls superclass method GitDS::ModelItem::new
# File doc/examples/test_suite/model.rb, line 282
def initialize(model, path)
  super
  @tests = GitDS::ModelItemList.new(TestModelItem, model, path)
end

Public Instance Methods

add_test( ident, modules = [] ) click to toggle source

Add a test to this suite.

# File doc/examples/test_suite/model.rb, line 317
def add_test( ident, modules = [] )
  ensure_valid
  t = TestModelItem.new @model, @tests.add(self, { :ident => ident } )
  modules.each { |m| t.add_module(m) }
end
del_test(ident) click to toggle source

Delete a test from this suite.

# File doc/examples/test_suite/model.rb, line 326
def del_test(ident)
  ensure_valid
  @tests.delete(ident)
end
description() click to toggle source

Description (e.g. purpose) of the tests.

# File doc/examples/test_suite/model.rb, line 290
def description
  property(:description)
end
description=(val) click to toggle source
# File doc/examples/test_suite/model.rb, line 294
def description=(val)
  set_property(:description, val)
end
perform_tests() { |t| ... } click to toggle source

Perform all tests in this TestSuite. This yields each Test to the supplied block. The code in the block is expected to update the Test object Properties :pass and :log.

# File doc/examples/test_suite/model.rb, line 336
def perform_tests(&block)
  suite = self
  @model.exec {
    suite.tests.each do |ident|
      t = suite.test(ident)
      yield t
    end
  }
end
test(ident) click to toggle source

Instantiate Test object.

# File doc/examples/test_suite/model.rb, line 309
def test(ident)
  ensure_valid
  @tests[ident]
end
tests() click to toggle source

List all tests in suite.

# File doc/examples/test_suite/model.rb, line 301
def tests
  ensure_valid
  @tests.keys
end