Class: Origen::Tester::Doc::Generator::Tests

Inherits:
Object
  • Object
show all
Defined in:
lib/origen/tester/doc/generator/tests.rb

Defined Under Namespace

Classes: IndexedString

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Tests) initialize

Returns a new instance of Tests



8
9
10
# File 'lib/origen/tester/doc/generator/tests.rb', line 8

def initialize
  @collection = []
end

Instance Attribute Details

- (Object) collection

Returns the value of attribute collection



6
7
8
# File 'lib/origen/tester/doc/generator/tests.rb', line 6

def collection
  @collection
end

Instance Method Details

- (Object) add(name, attrs = {})



20
21
22
23
24
25
26
27
28
# File 'lib/origen/tester/doc/generator/tests.rb', line 20

def add(name, attrs = {})
  test = Test.new(name, attrs)
  if @current_group
    @current_group << test
  else
    collection << test
  end
  test
end

- (Object) group(name = nil, options = {}) {|@current_group| ... } Also known as: add_group

Arbitrarily group a subset of tests together, see the J750 API for details on how to use this.

Yields:

  • (@current_group)


32
33
34
35
36
37
38
# File 'lib/origen/tester/doc/generator/tests.rb', line 32

def group(name = nil, options = {})
  name, options = nil, name if name.is_a?(Hash)
  @current_group = TestGroup.new(name, options)
  collection << @current_group
  yield @current_group
  @current_group = nil
end

- (Object) render(_file, _options = {})



41
42
# File 'lib/origen/tester/doc/generator/tests.rb', line 41

def render(_file, _options = {})
end