From 5fd6e546af5b5e4520f2cc88aaa5b705cdfd4249 Mon Sep 17 00:00:00 2001 From: Markus Roberts Date: Fri, 30 Apr 2010 16:39:08 -0700 Subject: Change the main spec to an apply spec This appears to have been left out of the preceeding commit sequence. --- spec/integration/application/apply.rb | 33 +++++++++++++++++++++++++++++++++ spec/integration/application/main.rb | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100755 spec/integration/application/apply.rb delete mode 100755 spec/integration/application/main.rb (limited to 'spec/integration/application') diff --git a/spec/integration/application/apply.rb b/spec/integration/application/apply.rb new file mode 100755 index 000000000..c6e73e880 --- /dev/null +++ b/spec/integration/application/apply.rb @@ -0,0 +1,33 @@ +#!/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" do + confine "PSON library is missing; cannot test applying catalogs" => Puppet.features.pson? + 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 diff --git a/spec/integration/application/main.rb b/spec/integration/application/main.rb deleted file mode 100755 index b8933e438..000000000 --- a/spec/integration/application/main.rb +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/../../spec_helper' - -require 'puppet_spec/files' - -require 'puppet/application/main' - -describe "main" do - include PuppetSpec::Files - - describe "when applying provided catalogs" do - confine "PSON library is missing; cannot test applying catalogs" => Puppet.features.pson? - 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[:main] - puppet.options[:catalog] = manifest - - puppet.apply - - File.should be_exist(file_to_create) - File.read(file_to_create).should == "my stuff" - end - end -end -- cgit