~ubuntu-branches/ubuntu/wily/puppet/wily

« back to all changes in this revision

Viewing changes to spec/unit/status_spec.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2014-04-17 14:50:28 UTC
  • mfrom: (3.1.59 sid)
  • Revision ID: package-import@ubuntu.com-20140417145028-j3p3dwvp8ggpzvaf
Tags: 3.5.1-1
ImportedĀ upstreamĀ releaseĀ 3.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env ruby
2
2
require 'spec_helper'
3
3
 
 
4
require 'matchers/json'
 
5
 
4
6
describe Puppet::Status do
 
7
  include JSONMatchers
 
8
 
5
9
  it "should implement find" do
6
10
    Puppet::Status.indirection.find( :default ).should be_is_a(Puppet::Status)
7
11
    Puppet::Status.indirection.find( :default ).status["is_alive"].should == true
38
42
    new_status.should equal_attributes_of(status)
39
43
  end
40
44
 
41
 
  it "serializes to PSON that conforms to the status schema", :unless => Puppet.features.microsoft_windows? do
42
 
    schema = JSON.parse(File.read('api/schemas/status.json'))
 
45
  it "serializes to PSON that conforms to the status schema" do
43
46
    status = Puppet::Status.new
44
47
    status.version = Puppet.version
45
48
 
46
 
    JSON::Validator.validate!(JSON_META_SCHEMA, schema)
47
 
    JSON::Validator.validate!(schema, status.render('pson'))
 
49
    expect(status.render('pson')).to validate_against('api/schemas/status.json')
48
50
  end
49
51
end