Created
January 3, 2015 20:31
-
-
Save dblessing/6bc6c00fcf81f3963c05 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming | |
template '/etc/foo' do | |
notifies :restart, 'service[apache2]' | |
end | |
# I can do this in ChefSpec | |
resource = chef_run.template('/etc/foo') | |
expect(resource).to notify('service[apache2]').to(:restart).delayed | |
# Now, if I create a custom LWRP and have this: | |
custom_lwrp 'thing1' do | |
notifies :restart, 'service[apache2]' | |
end | |
# How can I test that notification? This doesn't work: | |
resource = chef_run.custom_lwrp('thing1') | |
expect(resource).to notify('service[apache2]').to(:restart).delayed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment