Sha256: 395fa21ac8ffe4d893bc60d9a1cf9b5c3fa45538d968b21e4aef5b5e2e3b1989

Contents?: true

Size: 894 Bytes

Versions: 14

Compression:

Stored size: 894 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../spec_helper'

require 'puppet_spec/files'

require 'puppet/application/apply'

describe "apply" do
  include PuppetSpec::Files

  describe "when applying provided catalogs", :if => Puppet.features.pson? do
    it "should be able to apply catalogs provided in a file in pson" do
      file_to_create = tmpfile("pson_catalog")
      catalog = Puppet::Resource::Catalog.new
      resource = Puppet::Resource.new(:file, file_to_create, :parameters => {:content => "my stuff"})
      catalog.add_resource resource

      manifest = tmpfile("manifest")

      File.open(manifest, "w") { |f| f.print catalog.to_pson }

      puppet = Puppet::Application[:apply]
      puppet.options[:catalog] = manifest

      puppet.apply

      File.should be_exist(file_to_create)
      File.read(file_to_create).should == "my stuff"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
puppet-2.6.18 spec/integration/application/apply_spec.rb
puppet-2.6.17 spec/integration/application/apply_spec.rb
puppet-2.6.16 spec/integration/application/apply_spec.rb
puppet-2.6.15 spec/integration/application/apply_spec.rb
puppet-2.6.14 spec/integration/application/apply_spec.rb
puppet-2.6.13 spec/integration/application/apply_spec.rb
puppet-2.6.12 spec/integration/application/apply_spec.rb
puppet-2.6.11 spec/integration/application/apply_spec.rb
puppet-2.6.10 spec/integration/application/apply_spec.rb
puppet-2.6.9 spec/integration/application/apply_spec.rb
puppet-2.6.8 spec/integration/application/apply_spec.rb
puppet-2.6.7 spec/integration/application/apply_spec.rb
puppet-2.6.6 spec/integration/application/apply_spec.rb
puppet-2.6.5 spec/integration/application/apply_spec.rb