diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-03-07 19:48:40 -0500 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-03-07 19:48:40 -0500 |
commit | 9e1cf99ccf12de2edaf73af73a8410e5cac6dd72 (patch) | |
tree | 2624c5c96549324719fbf6eaca781888d6d4646d /spec/classes/anchor_spec.rb | |
parent | fecb53d46ed9e926973cdf5be1289c1ea71c2f68 (diff) | |
parent | 3854e076ccb75d1bcb1ddd29f5976b194d857765 (diff) |
Merge pull request #230 from apenney/fix-testing
[WIP] Spec overhaul.
Diffstat (limited to 'spec/classes/anchor_spec.rb')
-rw-r--r-- | spec/classes/anchor_spec.rb | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/spec/classes/anchor_spec.rb b/spec/classes/anchor_spec.rb index 2dd17de..2e1fcba 100644 --- a/spec/classes/anchor_spec.rb +++ b/spec/classes/anchor_spec.rb @@ -1,31 +1,28 @@ -require 'puppet' -require 'rspec-puppet' +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 |