Class: PuppetUnitTests::DefineUsecase
- Inherits:
-
TestUsecase
- Object
- TestUsecase
- PuppetUnitTests::DefineUsecase
- Defined in:
- lib/puppet_unit_tests/test_usecase.rb
Overview
A test usecase for a Puppet defined type.
Instance Attribute Summary collapse
-
#parameters ⇒ Object
Returns the value of attribute parameters.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from TestUsecase
#absent, #error, #facts, #hiera, #name, #present, #server_facts, #settings, #trusted_facts
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ DefineUsecase
constructor
A new instance of DefineUsecase.
Constructor Details
#initialize(name) ⇒ DefineUsecase
Returns a new instance of DefineUsecase.
72 73 74 75 76 77 |
# File 'lib/puppet_unit_tests/test_usecase.rb', line 72 def initialize(name) super @title = nil @parameters = {} end |
Instance Attribute Details
#parameters ⇒ Object
Returns the value of attribute parameters.
70 71 72 |
# File 'lib/puppet_unit_tests/test_usecase.rb', line 70 def parameters @parameters end |
#title ⇒ Object
Returns the value of attribute title.
69 70 71 |
# File 'lib/puppet_unit_tests/test_usecase.rb', line 69 def title @title end |
Class Method Details
.parse(name, data) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/puppet_unit_tests/test_usecase.rb', line 80 def parse(name, data) uc = super if data.nil? || !data.key?("title") raise UserDataError, "Missing title for defined type #{@name}" end uc.title = data["title"] uc.parameters = data["parameters"] || {} uc end |