~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to spec/unit/face/secret_agent_spec.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 01:00:37 UTC
  • mfrom: (1.1.24 upstream) (3.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110725010037-875vuxs10eboqgw3
Tags: 2.7.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/puppetmaster-passenger.postinst: Use cacrl instead of hostcrl to
    set the location of the CRL in apache2 configuration. Fix apache2
    configuration on upgrade as well (LP: #641001)
  - move all puppet dependencies to puppet-common since all the code
    actually located in puppet-common.
  - move libagueas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env rspec
 
2
require 'spec_helper'
 
3
require 'puppet/face'
 
4
require 'puppet/indirector/catalog/rest'
 
5
require 'tempfile'
 
6
 
 
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)
 
18
 
 
19
      report = subject.synchronize
 
20
 
 
21
      report.kind.should   == "apply"
 
22
      report.status.should == "changed"
 
23
    end
 
24
  end
 
25
end