Sha256: dd40d2ded76d6c13accb0a6e317bc83524703d2fe95a6b84d2c9f5faa8bae261

Contents?: true

Size: 1.62 KB

Versions: 4

Compression:

Stored size: 1.62 KB

Contents

#! /usr/bin/env ruby -S rspec
require 'spec_helper'

require 'puppet/util/instrumentation/listener'
require 'puppet/indirector/instrumentation_data/local'

describe Puppet::Indirector::InstrumentationData::Local do
  it "should be a subclass of the Code terminus" do
    Puppet::Indirector::InstrumentationData::Local.superclass.should equal(Puppet::Indirector::Code)
  end

  it "should be registered with the configuration store indirection" do
    indirection = Puppet::Indirector::Indirection.instance(:instrumentation_data)
    Puppet::Indirector::InstrumentationData::Local.indirection.should equal(indirection)
  end

  it "should have its name set to :local" do
    Puppet::Indirector::InstrumentationData::Local.name.should == :local
  end
end

describe Puppet::Indirector::InstrumentationData::Local do
  before :each do
    Puppet::Util::Instrumentation.stubs(:listener)
    @data = Puppet::Indirector::InstrumentationData::Local.new
    @name = "me"
    @request = stub 'request', :key => @name
  end

  describe "when finding instrumentation data" do
    it "should return a Instrumentation Data instance matching the key" do
    end
  end

  describe "when searching listeners" do
    it "should raise an error" do
      lambda { @data.search(@request) }.should raise_error(Puppet::DevError)
    end
  end

  describe "when saving listeners" do
    it "should raise an error" do
      lambda { @data.save(@request) }.should raise_error(Puppet::DevError)
    end
  end

  describe "when destroying listeners" do
    it "should raise an error" do
      lambda { @data.destroy(@reques) }.should raise_error(Puppet::DevError)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-3.0.0.rc8 spec/unit/indirector/instrumentation_data/local_spec.rb
puppet-3.0.0.rc7 spec/unit/indirector/instrumentation_data/local_spec.rb
puppet-3.0.0.rc5 spec/unit/indirector/instrumentation_data/local_spec.rb
puppet-3.0.0.rc4 spec/unit/indirector/instrumentation_data/local_spec.rb