diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-03-05 15:43:58 -0500 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-03-08 00:42:51 +0000 |
commit | 3854e076ccb75d1bcb1ddd29f5976b194d857765 (patch) | |
tree | 2624c5c96549324719fbf6eaca781888d6d4646d /spec/classes | |
parent | fecb53d46ed9e926973cdf5be1289c1ea71c2f68 (diff) |
Numerous changes to update testing gems.
This work updates a number of Gems to the latest versions (rspec,
rspec-puppet), and updates and tweaks a bunch of tests to work
with the updated gems.
Diffstat (limited to 'spec/classes')
-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 |