Module: RSpec::Puppet::ManifestMatchers
Defined Under Namespace
Classes: Compile, CountGeneric, CreateGeneric, ParameterMatcher
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
3
4
5
6
7
8
|
# File 'lib/rspec-puppet/matchers/dynamic_matchers.rb', line 3
def method_missing(method, *args, &block)
return RSpec::Puppet::ManifestMatchers::CreateGeneric.new(method, *args, &block) if method.to_s =~ /^(create|contain)_/
return RSpec::Puppet::ManifestMatchers::CountGeneric.new(nil, args[0], method) if method.to_s =~ /^have_.+_count$/
return RSpec::Puppet::ManifestMatchers::Compile.new if method == :compile
super
end
|
Instance Method Details
#have_class_count(count) ⇒ Object
67
68
69
|
# File 'lib/rspec-puppet/matchers/count_generic.rb', line 67
def have_class_count(count)
RSpec::Puppet::ManifestMatchers::CountGeneric.new('class', count)
end
|
#have_resource_count(count) ⇒ Object
71
72
73
|
# File 'lib/rspec-puppet/matchers/count_generic.rb', line 71
def have_resource_count(count)
RSpec::Puppet::ManifestMatchers::CountGeneric.new('resource', count)
end
|