2d4455e417e191fbf1379f3c8a2798c03e3eb6a7
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / classes / anchor_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper'
3 require 'puppet_spec/compiler'
4
5 describe "anchorrefresh" do
6   include PuppetSpec::Compiler
7
8   let :transaction do
9     apply_compiled_manifest(<<-ANCHORCLASS)
10       class anchored {
11         anchor { 'anchored::begin': }
12         ~> anchor { 'anchored::end': }
13       }
14
15       class anchorrefresh {
16         notify { 'first': }
17         ~> class { 'anchored': }
18         ~> anchor { 'final': }
19       }
20
21       include anchorrefresh
22     ANCHORCLASS
23   end
24
25   it 'propagates events through the anchored class' do
26     resource = transaction.resource_status('Anchor[final]')
27
28     expect(resource.restarted).to eq(true)
29   end
30 end