summaryrefslogtreecommitdiffstats
path: root/spec/integration/indirector
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/indirector
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/indirector')
-rwxr-xr-xspec/integration/indirector/catalog/compiler_spec.rb6
-rwxr-xr-xspec/integration/indirector/file_content/file_server_spec.rb6
-rwxr-xr-xspec/integration/indirector/node/ldap_spec.rb2
3 files changed, 7 insertions, 7 deletions
diff --git a/spec/integration/indirector/catalog/compiler_spec.rb b/spec/integration/indirector/catalog/compiler_spec.rb
index ede502e3c..dcb7eb425 100755
--- a/spec/integration/indirector/catalog/compiler_spec.rb
+++ b/spec/integration/indirector/catalog/compiler_spec.rb
@@ -42,7 +42,7 @@ describe Puppet::Resource::Catalog::Compiler do
Puppet::Resource::Catalog.indirection.terminus.stubs(:node_from_request)
Puppet::Resource::Catalog.indirection.terminus.stubs(:compile).returns(@catalog)
- Puppet::Resource::Catalog.find(request).resource_refs.should == [ @two.ref ]
+ Puppet::Resource::Catalog.indirection.find(request).resource_refs.should == [ @two.ref ]
end
it "should not filter out exported resources when finding a catalog" do
@@ -52,7 +52,7 @@ describe Puppet::Resource::Catalog::Compiler do
Puppet::Resource::Catalog.indirection.terminus.stubs(:node_from_request)
Puppet::Resource::Catalog.indirection.terminus.stubs(:compile).returns(@catalog)
- Puppet::Resource::Catalog.find(request).resource_refs.sort.should == [ @one.ref, @two.ref ]
+ Puppet::Resource::Catalog.indirection.find(request).resource_refs.sort.should == [ @one.ref, @two.ref ]
end
it "should filter out virtual exported resources when finding a catalog" do
@@ -63,6 +63,6 @@ describe Puppet::Resource::Catalog::Compiler do
Puppet::Resource::Catalog.indirection.terminus.stubs(:node_from_request)
Puppet::Resource::Catalog.indirection.terminus.stubs(:compile).returns(@catalog)
- Puppet::Resource::Catalog.find(request).resource_refs.should == [ @two.ref ]
+ Puppet::Resource::Catalog.indirection.find(request).resource_refs.should == [ @two.ref ]
end
end
diff --git a/spec/integration/indirector/file_content/file_server_spec.rb b/spec/integration/indirector/file_content/file_server_spec.rb
index 5de7f1de0..2992c40f2 100755
--- a/spec/integration/indirector/file_content/file_server_spec.rb
+++ b/spec/integration/indirector/file_content/file_server_spec.rb
@@ -34,7 +34,7 @@ describe Puppet::Indirector::FileContent::FileServer, " when finding files" do
env = Puppet::Node::Environment.new("foo")
env.stubs(:modulepath).returns [path]
- result = Puppet::FileServing::Content.search("plugins", :environment => "foo", :recurse => true)
+ result = Puppet::FileServing::Content.indirection.search("plugins", :environment => "foo", :recurse => true)
result.should_not be_nil
result.length.should == 2
@@ -54,7 +54,7 @@ describe Puppet::Indirector::FileContent::FileServer, " when finding files" do
Puppet.settings[:modulepath] = path
- result = Puppet::FileServing::Content.find("modules/mymod/myfile")
+ result = Puppet::FileServing::Content.indirection.find("modules/mymod/myfile")
result.should_not be_nil
result.should be_instance_of(Puppet::FileServing::Content)
@@ -85,7 +85,7 @@ describe Puppet::Indirector::FileContent::FileServer, " when finding files" do
path = File.join(@path, "myfile")
- result = Puppet::FileServing::Content.find("one/myfile", :environment => "foo", :node => "mynode")
+ result = Puppet::FileServing::Content.indirection.find("one/myfile", :environment => "foo", :node => "mynode")
result.should_not be_nil
result.should be_instance_of(Puppet::FileServing::Content)
diff --git a/spec/integration/indirector/node/ldap_spec.rb b/spec/integration/indirector/node/ldap_spec.rb
index e4c0867ad..b13f3c033 100755
--- a/spec/integration/indirector/node/ldap_spec.rb
+++ b/spec/integration/indirector/node/ldap_spec.rb
@@ -10,6 +10,6 @@ describe Puppet::Node::Ldap do
Puppet::Node.indirection.stubs(:terminus).returns ldap
ldap.expects(:ldapsearch).with("(&(objectclass=puppetClient)(puppetclass=foo))")
- Puppet::Node.search "eh", :class => "foo"
+ Puppet::Node.indirection.search "eh", :class => "foo"
end
end