diff options
| author | Luke Kanies <luke@madstop.com> | 2009-08-10 04:31:26 +0000 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-08-10 17:39:40 +1000 |
| commit | a88fc4d24c50d91aa764fa8f52797e86bb6d8965 (patch) | |
| tree | e4d77ea5dcdd29cf039788d5e37ac41e183bc644 /spec/integration/application | |
| parent | 9a356ab289a64245cf59cd763dc953a93d71682b (diff) | |
Fixing more tests broken from missing libraries
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration/application')
| -rwxr-xr-x | spec/integration/application/puppet.rb | 27 |
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 |
