# manifests/splunk/service.pp
class tpp::splunk::service
exec { 'splunk-accept-license':
command => '/opt/splunkforwarder/bin/splunk enable boot-start --accept-license --answer-yes --no-prompt',
creates => '/etc/init.d/splunk',
before => Service['splunk'],
require => Class['splunk::install'],
}
...
} it { is_expected.to contain_exec('splunk-accept-license')
.with(
'command' => '/opt/splunkforwarder/bin/splunk enable boot-start --accept-license --answer-yes --no-prompt',
'creates' => '/etc/init.d/splunk',
'require' => 'Class[Tpp::Splunk::Install]',
)} it { should contain_exec('splunk-accept-license')
.that_requires('Class[Tpp::Splunk::Install]')
} 1) tpp::splunk::service when tpp is installed should contain Exec[splunk-accept-license] that requires Class[tpp::Splunk::Install]
Failure/Error: it { should contain_exec('splunk-accept-license').that_requires('Class[tpp::Splunk::Install]')}
expected that the catalogue would contain Exec[splunk-accept-license] with that requires Class[tpp::Splunk::Install]
# ./spec/classes/splunk/service_spec.rb:28:in `block (3 levels) in <top (required)>'To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/72a6385e-96df-4775-964d-8bb8a15698b2%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
it { is_expected.to contain_exec('splunk-accept-license')
.with(
'command' => '/opt/splunkforwarder/bin/splunk enable boot-start --accept-license --answer-yes --no-prompt',
'creates' => '/etc/init.d/splunk',
'require' => 'Class[Splunk::Install]',
)} expected that the catalogue would contain Exec[splunk-accept-license] with require set to "Class[Splunk::Install]" but it is set to Class[Tpp::Splunk::Install]{:name=>"Tpp::Splunk::Install"}