diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-07-16 15:17:12 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-18 19:44:12 -0700 |
| commit | 9f915402f5cf54c0f78dd34fefdde5f2f840cda7 (patch) | |
| tree | fd26c1562f8fbfcc28dadeeedb0667b7de33c451 /spec | |
| parent | 680dd1ace4b616908d76539befcbdf03feb1cef9 (diff) | |
| download | puppet-9f915402f5cf54c0f78dd34fefdde5f2f840cda7.tar.gz puppet-9f915402f5cf54c0f78dd34fefdde5f2f840cda7.tar.xz puppet-9f915402f5cf54c0f78dd34fefdde5f2f840cda7.zip | |
[#4256] External nodes parameters can now be assigned to nodes
Node parameters were made a reader instead of an accessor in
commit b82b4ef04282ca0006931562f60459a1591b6268
Author: Luke Kanies <luke@reductivelabs.com>
Date: Wed Jan 6 17:42:42 2010 -0800
All non-transient parser references are gone
but external nodes needs to be able to assign to parameters. The fix is
just to change that back to an accessor. There may have been concern
over nodes replacing the hash object instead of the values could have
bad consequences, but that's not a concern since the node object being
created in this case is new also.
Paired with: Nick Lewis
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/indirector/node/exec_spec.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/unit/indirector/node/exec_spec.rb b/spec/unit/indirector/node/exec_spec.rb index d5299ad16..d214a5ef6 100755 --- a/spec/unit/indirector/node/exec_spec.rb +++ b/spec/unit/indirector/node/exec_spec.rb @@ -25,8 +25,9 @@ describe Puppet::Node::Exec do describe "when handling the results of the command" do before do - @node = stub 'node', :fact_merge => nil @name = "yay" + @node = Puppet::Node.new(@name) + @node.stubs(:fact_merge) Puppet::Node.expects(:new).with(@name).returns(@node) @result = {} # Use a local variable so the reference is usable in the execute definition. @@ -45,14 +46,14 @@ describe Puppet::Node::Exec do it "should set the resulting parameters as the node parameters" do @result[:parameters] = {"a" => "b", "c" => "d"} - @node.expects(:parameters=).with "a" => "b", "c" => "d" @searcher.find(@request) + @node.parameters.should == {"a" => "b", "c" => "d"} end it "should set the resulting classes as the node classes" do @result[:classes] = %w{one two} - @node.expects(:classes=).with %w{one two} @searcher.find(@request) + @node.classes.should == [ 'one', 'two' ] end it "should merge the node's facts with its parameters" do @@ -62,8 +63,8 @@ describe Puppet::Node::Exec do it "should set the node's environment if one is provided" do @result[:environment] = "yay" - @node.expects(:environment=).with "yay" @searcher.find(@request) + @node.environment.to_s.should == 'yay' end end end |
