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