summaryrefslogtreecommitdiffstats
path: root/spec/unit/indirector/code_spec.rb
blob: 29369bf5e4b3c88b07f82ee0f2a608bd965927c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env rspec
require 'spec_helper'
require 'puppet/indirector/code'

describe Puppet::Indirector::Code do
  before :all do
    Puppet::Indirector::Terminus.stubs(:register_terminus_class)
    @model = mock 'model'
    @indirection = stub 'indirection', :name => :mystuff, :register_terminus_type => nil, :model => @model
    Puppet::Indirector::Indirection.stubs(:instance).returns(@indirection)

    module Testing; end
    @code_class = class Testing::MyCode < Puppet::Indirector::Code
      self
    end

    @searcher = @code_class.new
  end

  it "should not have a find() method defined" do
    @searcher.should_not respond_to(:find)
  end

  it "should not have a save() method defined" do
    @searcher.should_not respond_to(:save)
  end

  it "should not have a destroy() method defined" do
    @searcher.should_not respond_to(:destroy)
  end
end