Sha256: 40b91a63fcf5f3a3e586563b7de9a087c7c901d795f1939c3cffe687d5876590

Contents?: true

Size: 675 Bytes

Versions: 21

Compression:

Stored size: 675 Bytes

Contents

require 'puppet'
require 'rspec-puppet'

describe "anchorrefresh" do
  let(:node) { 'testhost.example.com' }
  let :pre_condition do
    <<-ANCHORCLASS
class anchored {
  anchor { 'anchored::begin': }
  ~> anchor { 'anchored::end': }
}

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

  def apply_catalog_and_return_exec_rsrc
    catalog = subject.to_ral
    transaction = catalog.apply
    transaction.resource_status("Anchor[final]")
  end

  it 'propagates events through the anchored class' do
    resource = apply_catalog_and_return_exec_rsrc

    expect(resource.restarted).to eq(true)
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
puppetmodule-stdlib-4.0.2 spec/classes/anchor_spec.rb