Sha256: aa612c48f7df7256af4e9747b071d6663ac7fbc1b34f6ab67aa064e29b71284f

Contents?: true

Size: 852 Bytes

Versions: 340

Compression:

Stored size: 852 Bytes

Contents

require 'spec_helper'
require 'puppet/indirector/plain'

describe Puppet::Indirector::Plain do
  before do
    allow(Puppet::Indirector::Terminus).to receive(:register_terminus_class)
    @model = double('model')
    @indirection = double('indirection', :name => :mystuff, :register_terminus_type => nil, :model => @model)
    allow(Puppet::Indirector::Indirection).to receive(:instance).and_return(@indirection)

    module Testing; end
    @plain_class = class Testing::MyPlain < Puppet::Indirector::Plain
      self
    end

    @searcher = @plain_class.new

    @request = double('request', :key => "yay")
  end

  it "should return return an instance of the indirected model" do
    object = double('object')
    expect(@model).to receive(:new).with(@request.key).and_return(object)
    expect(@searcher.find(@request)).to equal(object)
  end
end

Version data entries

340 entries across 340 versions & 1 rubygems

Version Path
puppet-8.3.0 spec/unit/indirector/plain_spec.rb
puppet-8.3.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-8.3.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-8.3.0-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-8.4.0 spec/unit/indirector/plain_spec.rb
puppet-8.4.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-8.4.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-8.4.0-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-7.28.0 spec/unit/indirector/plain_spec.rb
puppet-7.28.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-7.28.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-7.28.0-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-8.3.1 spec/unit/indirector/plain_spec.rb
puppet-8.3.1-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-8.3.1-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-8.3.1-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-7.27.0 spec/unit/indirector/plain_spec.rb
puppet-7.27.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-7.27.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-7.27.0-universal-darwin spec/unit/indirector/plain_spec.rb