summaryrefslogtreecommitdiff
path: root/spec/classes/anchor_spec.rb
blob: 2e1fcba4655d06a10b16cb296455a862df24906e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'
require 'puppet_spec/compiler'

describe "anchorrefresh" do
  include PuppetSpec::Compiler

  let :transaction do
    apply_compiled_manifest(<<-ANCHORCLASS)
      class anchored {
        anchor { 'anchored::begin': }
        ~> anchor { 'anchored::end': }
      }

      class anchorrefresh {
        notify { 'first': }
        ~> class { 'anchored': }
        ~> anchor { 'final': }
      }

      include anchorrefresh
    ANCHORCLASS
  end

  it 'propagates events through the anchored class' do
    resource = transaction.resource_status('Anchor[final]')

    expect(resource.restarted).to eq(true)
  end
end