From 3854e076ccb75d1bcb1ddd29f5976b194d857765 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Wed, 5 Mar 2014 15:43:58 -0500 Subject: 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. --- spec/classes/anchor_spec.rb | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'spec/classes/anchor_spec.rb') 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 -- cgit v1.2.3