diff options
Diffstat (limited to 'spec/classes')
-rwxr-xr-x[-rw-r--r--] | spec/classes/anchor_spec.rb | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/spec/classes/anchor_spec.rb b/spec/classes/anchor_spec.rb index 2dd17de..2d4455e 100644..100755 --- a/spec/classes/anchor_spec.rb +++ b/spec/classes/anchor_spec.rb @@ -1,31 +1,29 @@ -require 'puppet' -require 'rspec-puppet' +#! /usr/bin/env ruby -S rspec +require 'spec_helper' +require 'puppet_spec/compiler' describe "anchorrefresh" do - let(:node) { 'testhost.example.com' } - let :pre_condition do - <<-ANCHORCLASS -class anchored { - anchor { 'anchored::begin': } - ~> anchor { 'anchored::end': } -} + include PuppetSpec::Compiler -class anchorrefresh { - notify { 'first': } - ~> class { 'anchored': } - ~> anchor { 'final': } -} - ANCHORCLASS - end + let :transaction do + apply_compiled_manifest(<<-ANCHORCLASS) + class anchored { + anchor { 'anchored::begin': } + ~> anchor { 'anchored::end': } + } - def apply_catalog_and_return_exec_rsrc - catalog = subject.to_ral - transaction = catalog.apply - transaction.resource_status("Anchor[final]") + class anchorrefresh { + notify { 'first': } + ~> class { 'anchored': } + ~> anchor { 'final': } + } + + include anchorrefresh + ANCHORCLASS end it 'propagates events through the anchored class' do - resource = apply_catalog_and_return_exec_rsrc + resource = transaction.resource_status('Anchor[final]') expect(resource.restarted).to eq(true) end |