summaryrefslogtreecommitdiffstats
path: root/spec/integration/application
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/application')
-rwxr-xr-xspec/integration/application/puppet.rb27
1 files changed, 15 insertions, 12 deletions
diff --git a/spec/integration/application/puppet.rb b/spec/integration/application/puppet.rb
index 0047dd5a3..e3f8fb9fc 100755
--- a/spec/integration/application/puppet.rb
+++ b/spec/integration/application/puppet.rb
@@ -9,22 +9,25 @@ require 'puppet/application/puppet'
describe "Puppet" do
include PuppetSpec::Files
- it "should be able to apply catalogs provided in a file in json" do
- file_to_create = tmpfile("json_catalog")
- catalog = Puppet::Resource::Catalog.new
- resource = Puppet::Resource.new(:file, file_to_create, :content => "my stuff")
- catalog.add_resource resource
+ describe "when applying provided catalogs" do
+ confine "JSON library is missing; cannot test applying catalogs" => Puppet.features.json?
+ it "should be able to apply catalogs provided in a file in json" do
+ file_to_create = tmpfile("json_catalog")
+ catalog = Puppet::Resource::Catalog.new
+ resource = Puppet::Resource.new(:file, file_to_create, :content => "my stuff")
+ catalog.add_resource resource
- manifest = tmpfile("manifest")
+ manifest = tmpfile("manifest")
- File.open(manifest, "w") { |f| f.print catalog.to_json }
+ File.open(manifest, "w") { |f| f.print catalog.to_json }
- puppet = Puppet::Application[:puppet]
- puppet.options[:catalog] = manifest
+ puppet = Puppet::Application[:puppet]
+ puppet.options[:catalog] = manifest
- puppet.apply
+ puppet.apply
- File.should be_exist(file_to_create)
- File.read(file_to_create).should == "my stuff"
+ File.should be_exist(file_to_create)
+ File.read(file_to_create).should == "my stuff"
+ end
end
end