summaryrefslogtreecommitdiffstats
path: root/spec/integration/node_spec.rb
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-29 11:55:00 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-29 12:08:19 -0800
commit14f8160674628340ccfd79baeb84f66cf1e0398a (patch)
tree8acca5047c3e810535786b14c967e51c0623485f /spec/integration/node_spec.rb
parent52f9ef06507d87026936dc90dcb467a728ebd54f (diff)
downloadpuppet-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/integration/node_spec.rb')
-rwxr-xr-xspec/integration/node_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/integration/node_spec.rb b/spec/integration/node_spec.rb
index c635e7f32..0d46259dd 100755
--- a/spec/integration/node_spec.rb
+++ b/spec/integration/node_spec.rb
@@ -24,7 +24,7 @@ describe Puppet::Node do
terminus.expects(:translate).with(@name, "myresults").returns "translated_results"
terminus.expects(:create_node).with(@name, "translated_results").returns @node
- Puppet::Node.find(@name).should equal(@node)
+ Puppet::Node.indirection.find(@name).should equal(@node)
end
it "should be able to use the yaml terminus" do
@@ -36,7 +36,7 @@ describe Puppet::Node do
terminus.expects(:path).with(@name).returns "/my/yaml/file"
FileTest.expects(:exist?).with("/my/yaml/file").returns false
- Puppet::Node.find(@name).should be_nil
+ Puppet::Node.indirection.find(@name).should be_nil
end
it "should have an ldap terminus" do
@@ -51,7 +51,7 @@ describe Puppet::Node do
Puppet::Node.expects(:new).with(@name).returns @node
- Puppet::Node.find(@name).should equal(@node)
+ Puppet::Node.indirection.find(@name).should equal(@node)
end
describe "and using the memory terminus" do
@@ -64,29 +64,29 @@ describe Puppet::Node do
end
it "should find no nodes by default" do
- Puppet::Node.find(@name).should be_nil
+ Puppet::Node.indirection.find(@name).should be_nil
end
it "should be able to find nodes that were previously saved" do
@node.save
- Puppet::Node.find(@name).should equal(@node)
+ Puppet::Node.indirection.find(@name).should equal(@node)
end
it "should replace existing saved nodes when a new node with the same name is saved" do
@node.save
two = Puppet::Node.new(@name)
two.save
- Puppet::Node.find(@name).should equal(two)
+ Puppet::Node.indirection.find(@name).should equal(two)
end
it "should be able to remove previously saved nodes" do
@node.save
- Puppet::Node.destroy(@node.name)
- Puppet::Node.find(@name).should be_nil
+ Puppet::Node.indirection.destroy(@node.name)
+ Puppet::Node.indirection.find(@name).should be_nil
end
it "should fail when asked to destroy a node that does not exist" do
- proc { Puppet::Node.destroy(@node) }.should raise_error(ArgumentError)
+ proc { Puppet::Node.indirection.destroy(@node) }.should raise_error(ArgumentError)
end
end
end