Class: Origen::Tester::Doc::Generator::Tests
- Defined in:
- lib/origen/tester/doc/generator/tests.rb
Defined Under Namespace
Classes: IndexedString
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
Instance Method Summary collapse
- #add(name, attrs = {}) ⇒ Object
-
#group(name = nil, options = {}) {|@current_group| ... } ⇒ Object
(also: #add_group)
Arbitrarily group a subset of tests together, see the J750 API for details on how to use this.
-
#initialize ⇒ Tests
constructor
A new instance of Tests.
- #render(_file, _options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Tests
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
#collection ⇒ Object
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
#add(name, attrs = {}) ⇒ Object
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 |
#group(name = nil, options = {}) {|@current_group| ... } ⇒ Object Also known as: add_group
Arbitrarily group a subset of tests together, see the J750 API for details on how to use this.
32 33 34 35 36 37 38 |
# File 'lib/origen/tester/doc/generator/tests.rb', line 32 def group(name = nil, = {}) name, = nil, name if name.is_a?(Hash) @current_group = TestGroup.new(name, ) collection << @current_group yield @current_group @current_group = nil end |