diff options
author | Paul Berry <paul@puppetlabs.com> | 2010-11-29 11:55:00 -0800 |
---|---|---|
committer | Paul Berry <paul@puppetlabs.com> | 2010-11-29 12:08:19 -0800 |
commit | 14f8160674628340ccfd79baeb84f66cf1e0398a (patch) | |
tree | 8acca5047c3e810535786b14c967e51c0623485f /spec/unit/node_spec.rb | |
parent | 52f9ef06507d87026936dc90dcb467a728ebd54f (diff) | |
download | puppet-14f8160674628340ccfd79baeb84f66cf1e0398a.tar.gz puppet-14f8160674628340ccfd79baeb84f66cf1e0398a.tar.xz puppet-14f8160674628340ccfd79baeb84f66cf1e0398a.zip |
Maint: Refactor tests to use <class>.indirection.<method>
Replaced uses of the find, search, destroy, and expire methods on
model classes with direct calls to the indirection objects. This
change affects tests only.
Diffstat (limited to 'spec/unit/node_spec.rb')
-rwxr-xr-x | spec/unit/node_spec.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index 36334ea05..725075cb3 100755 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -84,11 +84,11 @@ end describe Puppet::Node, "when merging facts" do before do @node = Puppet::Node.new("testnode") - Puppet::Node::Facts.stubs(:find).with(@node.name).returns(Puppet::Node::Facts.new(@node.name, "one" => "c", "two" => "b")) + Puppet::Node::Facts.indirection.stubs(:find).with(@node.name).returns(Puppet::Node::Facts.new(@node.name, "one" => "c", "two" => "b")) end it "should fail intelligently if it cannot find facts" do - Puppet::Node::Facts.expects(:find).with(@node.name).raises "foo" + Puppet::Node::Facts.indirection.expects(:find).with(@node.name).raises "foo" lambda { @node.fact_merge }.should raise_error(Puppet::Error) end @@ -128,13 +128,6 @@ describe Puppet::Node, "when merging facts" do end describe Puppet::Node, "when indirecting" do - it "should redirect to the indirection" do - @indirection = stub 'indirection', :name => :node - Puppet::Node.stubs(:indirection).returns(@indirection) - @indirection.expects(:find) - Puppet::Node.find(:my_node.to_s) - end - it "should default to the 'plain' node terminus" do Puppet::Node.indirection.terminus_class.should == :plain end |