Sha256: c882bca89f816f7cedbebf10fe90012ce5e1202994aead0354e0c24d1699c34e

Contents?: true

Size: 677 Bytes

Versions: 35

Compression:

Stored size: 677 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'

require 'puppet/util/json_lockfile'

describe Puppet::Util::JsonLockfile do
  require 'puppet_spec/files'
  include PuppetSpec::Files

  before(:each) do
    @lockfile = tmpfile("lock")
    @lock = Puppet::Util::JsonLockfile.new(@lockfile)
  end

  describe "#lock" do
    it "should create a lock file containing a json hash" do
      data = { "foo" => "foofoo", "bar" => "barbar" }
      @lock.lock(data)

      PSON.parse(File.read(@lockfile)).should == data
    end
  end

  it "should return the lock data" do
    data = { "foo" => "foofoo", "bar" => "barbar" }
    @lock.lock(data)
    @lock.lock_data.should == data
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
puppet-3.4.3 spec/unit/util/json_lockfile_spec.rb
puppet-3.4.2 spec/unit/util/json_lockfile_spec.rb
puppet-3.4.1 spec/unit/util/json_lockfile_spec.rb
puppet-3.4.0 spec/unit/util/json_lockfile_spec.rb
puppet-3.4.0.rc2 spec/unit/util/json_lockfile_spec.rb
puppet-3.4.0.rc1 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.2 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.1 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.1.rc3 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.1.rc2 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.1.rc1 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.0 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.0.rc3 spec/unit/util/json_lockfile_spec.rb
puppet-3.3.0.rc2 spec/unit/util/json_lockfile_spec.rb
puppet-3.2.4 spec/unit/util/json_lockfile_spec.rb
puppet-3.2.3 spec/unit/util/json_lockfile_spec.rb
puppet-3.2.3.rc1 spec/unit/util/json_lockfile_spec.rb
puppet-3.2.2 spec/unit/util/json_lockfile_spec.rb
puppet-3.2.1 spec/unit/util/json_lockfile_spec.rb
puppet-3.2.1.rc1 spec/unit/util/json_lockfile_spec.rb