Class: Thoreau::DSL::Context::Suite
- Inherits:
-
Object
- Object
- Thoreau::DSL::Context::Suite
- Includes:
- Logging
- Defined in:
- lib/thoreau/dsl/context/suite.rb
Instance Attribute Summary collapse
-
#suite_data ⇒ Object
readonly
Returns the value of attribute suite_data.
-
#test_clan_model ⇒ Object
readonly
Returns the value of attribute test_clan_model.
Instance Method Summary collapse
- #appendix(&block) ⇒ Object
- #cases(name = nil, &block) ⇒ Object (also: #test_cases)
-
#initialize(suite_data:, test_clan_model:) ⇒ Suite
constructor
A new instance of Suite.
Methods included from Logging
Constructor Details
#initialize(suite_data:, test_clan_model:) ⇒ Suite
Returns a new instance of Suite.
15 16 17 18 19 |
# File 'lib/thoreau/dsl/context/suite.rb', line 15 def initialize suite_data:, test_clan_model: raise "Suites must have (unique) names." if suite_data.name.blank? @suite_data = suite_data @test_clan_model = test_clan_model end |
Instance Attribute Details
#suite_data ⇒ Object (readonly)
Returns the value of attribute suite_data.
12 13 14 |
# File 'lib/thoreau/dsl/context/suite.rb', line 12 def suite_data @suite_data end |
#test_clan_model ⇒ Object (readonly)
Returns the value of attribute test_clan_model.
13 14 15 |
# File 'lib/thoreau/dsl/context/suite.rb', line 13 def test_clan_model @test_clan_model end |
Instance Method Details
#appendix(&block) ⇒ Object
31 32 33 34 |
# File 'lib/thoreau/dsl/context/suite.rb', line 31 def appendix(&block) logger.debug " adding appendix block" @suite_data.appendix_block = block end |
#cases(name = nil, &block) ⇒ Object Also known as: test_cases
23 24 25 26 27 |
# File 'lib/thoreau/dsl/context/suite.rb', line 23 def cases(name = nil, &block) name = self.suite_data.name if name.nil? logger.debug " + adding cases named `#{name}`" @suite_data.test_cases_blocks << [name, block] end |