File: none_spec.rb

package info (click to toggle)
puppet 4.8.2-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,736 kB
  • ctags: 14,616
  • sloc: ruby: 236,754; xml: 1,586; sh: 1,178; lisp: 299; sql: 103; yacc: 72; makefile: 52
file content (33 lines) | stat: -rw-r--r-- 894 bytes parent folder | download | duplicates (3)
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
32
33
require 'spec_helper'
require 'puppet/indirector/none'

describe Puppet::Indirector::None do
  before do
    Puppet::Indirector::Terminus.stubs(:register_terminus_class)
    Puppet::Indirector::Indirection.stubs(:instance).returns(indirection)

    module Testing; end
    @none_class = class Testing::None < Puppet::Indirector::None
      self
    end

    @data_binder = @none_class.new
  end

  let(:model)   { mock('model') }
  let(:request) { stub('request', :key => "port") }
  let(:indirection) do
    stub('indirection', :name => :none, :register_terminus_type => nil,
      :model => model)
  end

  it "should not be the default data_binding_terminus" do
    expect(Puppet.settings[:data_binding_terminus]).not_to eq('none')
  end

  describe "the behavior of the find method" do
    it "should just return nil" do
      expect(@data_binder.find(request)).to be_nil
    end
  end
end