diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2013-04-11 17:57:27 -0700 |
---|---|---|
committer | Jeff McCune <jeff@puppetlabs.com> | 2013-04-11 17:57:27 -0700 |
commit | 62bcb8fcf0d20fc5ddc41eb4cd5d4cfc6cba4c37 (patch) | |
tree | 6cc20a64cd311a271f7a937d12e1a27c03fc81e9 /spec/classes/anchor_spec.rb | |
parent | 8bf547991cf2ca65fa41fc3a15b75e88f6ac97fe (diff) | |
parent | d2e692dce3794a57da78bb4624b182d1b379ae6a (diff) | |
download | puppet-stdlib-62bcb8fcf0d20fc5ddc41eb4cd5d4cfc6cba4c37.tar.gz puppet-stdlib-62bcb8fcf0d20fc5ddc41eb4cd5d4cfc6cba4c37.tar.bz2 |
Merge branch 'philandstuff-master'
* philandstuff-master:
Add behavior example for anchor refresh propagation
Make the anchor type propagate refresh events
closes #78
Diffstat (limited to 'spec/classes/anchor_spec.rb')
-rw-r--r-- | spec/classes/anchor_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/classes/anchor_spec.rb b/spec/classes/anchor_spec.rb new file mode 100644 index 0000000..2dd17de --- /dev/null +++ b/spec/classes/anchor_spec.rb @@ -0,0 +1,32 @@ +require 'puppet' +require 'rspec-puppet' + +describe "anchorrefresh" do + let(:node) { 'testhost.example.com' } + let :pre_condition do + <<-ANCHORCLASS +class anchored { + anchor { 'anchored::begin': } + ~> anchor { 'anchored::end': } +} + +class anchorrefresh { + notify { 'first': } + ~> class { 'anchored': } + ~> anchor { 'final': } +} + ANCHORCLASS + end + + def apply_catalog_and_return_exec_rsrc + catalog = subject.to_ral + transaction = catalog.apply + transaction.resource_status("Anchor[final]") + end + + it 'propagates events through the anchored class' do + resource = apply_catalog_and_return_exec_rsrc + + expect(resource.restarted).to eq(true) + end +end |