Sha256: 81a3716df1b64c29ff829500c632b586839fb2358bac28baca3c50545fe8fe46

Contents?: true

Size: 869 Bytes

Versions: 4

Compression:

Stored size: 869 Bytes

Contents

#! /usr/bin/env ruby -S rspec
require '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

4 entries across 4 versions & 1 rubygems

Version Path
puppet-3.0.0.rc8 spec/integration/application/apply_spec.rb
puppet-3.0.0.rc7 spec/integration/application/apply_spec.rb
puppet-3.0.0.rc5 spec/integration/application/apply_spec.rb
puppet-3.0.0.rc4 spec/integration/application/apply_spec.rb