Sha256: e010d04adcfd60036b879bbe6d931df57d85d463669d99c2c189af7355ffb4a7

Contents?: true

Size: 639 Bytes

Versions: 5

Compression:

Stored size: 639 Bytes

Contents

#!/usr/bin/env ruby

Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }

require 'puppet/util/pson'

class PsonUtil
    include Puppet::Util::Pson
end

describe Puppet::Util::Pson do
    it "should fail if no data is provided" do
        lambda { PsonUtil.new.pson_create("type" => "foo") }.should raise_error(ArgumentError)
    end

    it "should call 'from_pson' with the provided data" do
        pson = PsonUtil.new
        pson.expects(:from_pson).with("mydata")
        pson.pson_create("type" => "foo", "data" => "mydata")
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-0.25.5 spec/unit/util/json.rb
puppet-0.25.4 spec/unit/util/json.rb
puppet-0.25.3 spec/unit/util/json.rb
puppet-0.25.2 spec/unit/util/json.rb
puppet-0.25.1 spec/unit/util/json.rb