diff options
Diffstat (limited to 'spec/integration/node_spec.rb')
-rwxr-xr-x | spec/integration/node_spec.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/integration/node_spec.rb b/spec/integration/node_spec.rb index c635e7f32..911a423a0 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.save(@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 + Puppet::Node.indirection.save(@node) two = Puppet::Node.new(@name) - two.save - Puppet::Node.find(@name).should equal(two) + Puppet::Node.indirection.save(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.save(@node) + 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 |