Sha256: 1c5f828478c9b79bc830e36835f0eab51c2297de79d77f2eacc6174f78b969e3

Contents?: true

Size: 870 Bytes

Versions: 35

Compression:

Stored size: 870 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'

require 'puppet/indirector/node/plain'

describe Puppet::Node::Plain do
  let(:nodename) { "mynode" }
  let(:fact_values) { {:afact => "a value"} }
  let(:facts) { Puppet::Node::Facts.new(nodename, fact_values) }
  let(:environment) { Puppet::Node::Environment.new("myenv") }
  let(:request) { Puppet::Indirector::Request.new(:node, :find, nodename, nil, :environment => environment) }
  let(:node_indirection) { Puppet::Node::Plain.new }

  before do
    Puppet::Node::Facts.indirection.expects(:find).with(nodename, :environment => environment).returns(facts)
  end

  it "merges facts into the node" do
    node_indirection.find(request).parameters.should include(fact_values)
  end

  it "should set the node environment from the request" do
    node_indirection.find(request).environment.should == environment
  end

end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
puppet-3.4.3 spec/unit/indirector/node/plain_spec.rb
puppet-3.4.2 spec/unit/indirector/node/plain_spec.rb
puppet-3.4.1 spec/unit/indirector/node/plain_spec.rb
puppet-3.4.0 spec/unit/indirector/node/plain_spec.rb
puppet-3.4.0.rc2 spec/unit/indirector/node/plain_spec.rb
puppet-3.4.0.rc1 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.2 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.1 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.1.rc3 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.1.rc2 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.1.rc1 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.0 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.0.rc3 spec/unit/indirector/node/plain_spec.rb
puppet-3.3.0.rc2 spec/unit/indirector/node/plain_spec.rb
puppet-3.2.4 spec/unit/indirector/node/plain_spec.rb
puppet-3.2.3 spec/unit/indirector/node/plain_spec.rb
puppet-3.2.3.rc1 spec/unit/indirector/node/plain_spec.rb
puppet-3.2.2 spec/unit/indirector/node/plain_spec.rb
puppet-3.2.1 spec/unit/indirector/node/plain_spec.rb
puppet-3.2.1.rc1 spec/unit/indirector/node/plain_spec.rb