summaryrefslogtreecommitdiff
path: root/spec/acceptance/anchor_spec.rb
blob: 24a90647ca3fa1b7c22c4e28b0dec6111a8bb92b (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
require 'spec_helper_acceptance'

describe 'anchor type' do
  describe 'success' do
    it 'should effect proper chaining of resources' do
      pp = <<-EOS
      class anchored {
        anchor { 'anchored::begin': }
        ~> anchor { 'anchored::end': }
      }

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

      include anchorrefresh
      EOS

      apply_manifest(pp, :catch_failures => true) do |r|
        expect(r.stdout).to match(/Anchor\[final\]: Triggered 'refresh'/)
      end
    end
  end
end