class TestModelItem

# ———————————————————————- A specific test. This identifies a specific test which is associated with one or more Modules. The testing software will invoke the perform method for each test it runs in order to update the test results in the database.

Public Class Methods

fill(model, item_path, args) click to toggle source
Calls superclass method
# File doc/examples/test_suite/model.rb, line 361
def self.fill(model, item_path, args)
  super
  # Note: by default, all tests are pass=false and timestamp=create_time
  properties[:timestamp].set(model, item_path, Time.now.to_s)
end
new(model, path) click to toggle source
Calls superclass method GitDS::ModelItem::new
# File doc/examples/test_suite/model.rb, line 367
def initialize(model, path)
  super
  @modules = GitDS::ProxyItemList.new(ModuleModelItem, model, path)
end

Public Instance Methods

add_module(m) click to toggle source

Associate a module with this test.

# File doc/examples/test_suite/model.rb, line 413
def add_module(m)
  ensure_valid
  @modules.add(self, m, true)
end
log() click to toggle source

The log from the latest run of the test.

# File doc/examples/test_suite/model.rb, line 398
def log
  property(:log)
end
modules() click to toggle source

List all modules associated with this test.

# File doc/examples/test_suite/model.rb, line 405
def modules
  ensure_valid
  @modules.keys
end
pass?() click to toggle source

The result of the latest run of the test.

# File doc/examples/test_suite/model.rb, line 391
def pass?
  bool_property(:pass)
end
perform(pass, log='', timestamp=Time.now) click to toggle source

Store the results of performing a test.

# File doc/examples/test_suite/model.rb, line 375
def perform(pass, log='', timestamp=Time.now)
  set_property(:pass, pass)
  set_property(:log, log)
  set_property(:timestamp, timestamp)
end
timestamp() click to toggle source

The timestamp of the latest run of the test.

# File doc/examples/test_suite/model.rb, line 384
def timestamp
  ts_property(:timestamp)
end