Sha256: 93186ac120f3bde112d08616bf2362603550db33cbd4c25148894b52a2b3ced1

Contents?: true

Size: 819 Bytes

Versions: 278

Compression:

Stored size: 819 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/indirector/plain'

describe Puppet::Indirector::Plain do
  before 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
    @plain_class = class Testing::MyPlain < Puppet::Indirector::Plain
      self
    end

    @searcher = @plain_class.new

    @request = stub 'request', :key => "yay"
  end

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

Version data entries

278 entries across 278 versions & 1 rubygems

Version Path
puppet-6.4.0 spec/unit/indirector/plain_spec.rb
puppet-6.4.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.4.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.4.0-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-6.0.7 spec/unit/indirector/plain_spec.rb
puppet-6.0.7-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.0.7-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.0.7-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-5.5.12 spec/unit/indirector/plain_spec.rb
puppet-5.5.12-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-5.5.12-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-5.5.12-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-6.3.0 spec/unit/indirector/plain_spec.rb
puppet-6.3.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.3.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.3.0-universal-darwin spec/unit/indirector/plain_spec.rb
puppet-6.2.0 spec/unit/indirector/plain_spec.rb
puppet-6.2.0-x86-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.2.0-x64-mingw32 spec/unit/indirector/plain_spec.rb
puppet-6.2.0-universal-darwin spec/unit/indirector/plain_spec.rb