Atom Powers
2014-Sep-12 17:49 UTC
[Puppet Users] Beaker-rspec problems using shared_examples
I'm trying to move some of my beaker-rspec tests into shared_examples. It
appears that I'm loosing something when I do that.
I'm hoping somebody with more rspec experience than me can shed some light
on what I need to do to get this to work.
The error looks like this:
----
Puppet::Error: Could not parse for environment production: No file(s) found
for import of '/etc/puppet/manifests/site.pp' at line 4 on node
test-node
#### Works
describe 'puppet apply' do
context 'with role webserver' do
manifest = "class { 'profiles::webserver': }"
it 'should work idempotently with no errors' do
apply_manifest(manifest, :catch_failures => true)
apply_manifest(manifest, :catch_changes => true)
end
describe service('nginx') do
it { should be_enabled }
it { should be_running }
end
end
end
#### Doesn't Work
shared_examples 'profiles::nginx' do
describe service('puppet') do
it { should be_enabled }
it { should be_running }
end
end
describe 'puppet apply' do
context 'with role webserver' do
manifest = "class { 'profiles::webserver': }"
it 'should work idempotently with no errors' do
apply_manifest(manifest, :catch_failures => true)
apply_manifest(manifest, :catch_changes => true)
end
include_examples 'profiles::nginx'
end
end
--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/CAF-H%3DOkXAT0kLroeR6BMTf%3DdOOxA-nXt_FGMsrbUqfmND5r%2BzA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.