4
require 'puppet/indirector/catalog/rest'
7
describe Puppet::Face[:secret_agent, '0.0.1'] do
8
describe "#synchronize" do
9
it "should retrieve and apply a catalog and return a report" do
10
pending "This test doesn't work, but the code actually does - tested by LAK"
11
dirname = Dir.mktmpdir("puppetdir")
12
Puppet[:vardir] = dirname
13
Puppet[:confdir] = dirname
14
@catalog = Puppet::Resource::Catalog.new
15
@file = Puppet::Resource.new(:file, File.join(dirname, "tmp_dir_resource"), :parameters => {:ensure => :present})
16
@catalog.add_resource(@file)
17
Puppet::Resource::Catalog::Rest.any_instance.stubs(:find).returns(@catalog)
19
report = subject.synchronize
21
report.kind.should == "apply"
22
report.status.should == "changed"