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

« back to all changes in this revision

Viewing changes to spec/unit/status_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 ruby
2
 
 
3
 
require File.dirname(__FILE__) + '/../spec_helper'
 
1
#!/usr/bin/env rspec
 
2
require 'spec_helper'
4
3
 
5
4
describe Puppet::Status do
6
5
  it "should implement find" do
7
 
    Puppet::Status.find( :default ).should be_is_a(Puppet::Status)
8
 
    Puppet::Status.find( :default ).status["is_alive"].should == true
 
6
    Puppet::Status.indirection.find( :default ).should be_is_a(Puppet::Status)
 
7
    Puppet::Status.indirection.find( :default ).status["is_alive"].should == true
9
8
  end
10
9
 
11
10
  it "should default to is_alive is true" do
16
15
    Puppet::Status.new.status.to_pson.should == '{"is_alive":true}'
17
16
  end
18
17
 
 
18
  it "should render to a pson hash" do
 
19
    PSON::pretty_generate(Puppet::Status.new).should =~ /"is_alive":\s*true/
 
20
  end
 
21
 
19
22
  it "should accept a hash from pson" do
20
23
    status = Puppet::Status.new( { "is_alive" => false } )
21
24
    status.status.should == { "is_alive" => false }