Module: RSpec::Puppet::TypeExampleGroup

Includes:
Support, TypeMatchers
Defined in:
lib/rspec-puppet/example/type_example_group.rb

Instance Method Summary collapse

Instance Method Details

#rspec_puppet_cleanupObject



22
23
24
# File 'lib/rspec-puppet/example/type_example_group.rb', line 22

def rspec_puppet_cleanup
  @type_and_resource = nil
end

#subjectObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rspec-puppet/example/type_example_group.rb', line 6

def subject
  @type_and_resource ||= begin
    setup_puppet
    type_name = self.class.top_level_description.downcase
    my_params = self.respond_to?(:params) ? params : {}
    [
      Puppet::Type.type(type_name),
      # I don't want to create the resource here, so I have
      # to pass all of the bits form the current scope
      # required to create it
      title,
      my_params
    ]
  end
end