From fe140a283fc51216a460be24c19641e26724c92c Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 9 Apr 2010 15:55:17 -0700 Subject: Migrating "puppet" executable integration test Signed-off-by: Luke Kanies --- spec/integration/application/main.rb | 33 +++++++++++++++++++++++++++++++++ spec/integration/application/puppet.rb | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) create mode 100755 spec/integration/application/main.rb delete mode 100755 spec/integration/application/puppet.rb (limited to 'spec') diff --git a/spec/integration/application/main.rb b/spec/integration/application/main.rb new file mode 100755 index 000000000..b8933e438 --- /dev/null +++ b/spec/integration/application/main.rb @@ -0,0 +1,33 @@ +#!/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 diff --git a/spec/integration/application/puppet.rb b/spec/integration/application/puppet.rb deleted file mode 100755 index cfafc9c0c..000000000 --- a/spec/integration/application/puppet.rb +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/../../spec_helper' - -require 'puppet_spec/files' - -require 'puppet/application/puppet' - -describe "Puppet" 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[:puppet] - 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