summaryrefslogtreecommitdiffstats
path: root/spec/integration/ssl
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/ssl
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/ssl')
-rwxr-xr-xspec/integration/ssl/certificate_authority_spec.rb10
-rwxr-xr-xspec/integration/ssl/certificate_request_spec.rb4
-rwxr-xr-xspec/integration/ssl/host_spec.rb4
3 files changed, 9 insertions, 9 deletions
diff --git a/spec/integration/ssl/certificate_authority_spec.rb b/spec/integration/ssl/certificate_authority_spec.rb
index 67ff6f215..622f7ed01 100755
--- a/spec/integration/ssl/certificate_authority_spec.rb
+++ b/spec/integration/ssl/certificate_authority_spec.rb
@@ -47,7 +47,7 @@ describe Puppet::SSL::CertificateAuthority do
it "should be able to generate a new host certificate" do
@ca.generate("newhost")
- Puppet::SSL::Certificate.find("newhost").should be_instance_of(Puppet::SSL::Certificate)
+ Puppet::SSL::Certificate.indirection.find("newhost").should be_instance_of(Puppet::SSL::Certificate)
end
it "should be able to revoke a host certificate" do
@@ -94,7 +94,7 @@ describe Puppet::SSL::CertificateAuthority do
it "should save the signed certificate" do
@ca.sign("luke.madstop.com")
- Puppet::SSL::Certificate.find("luke.madstop.com").should be_instance_of(Puppet::SSL::Certificate)
+ Puppet::SSL::Certificate.indirection.find("luke.madstop.com").should be_instance_of(Puppet::SSL::Certificate)
end
it "should be able to sign multiple certificates" do
@@ -107,15 +107,15 @@ describe Puppet::SSL::CertificateAuthority do
@ca.sign("luke.madstop.com")
@ca.sign("other.madstop.com")
- Puppet::SSL::Certificate.find("other.madstop.com").should be_instance_of(Puppet::SSL::Certificate)
- Puppet::SSL::Certificate.find("luke.madstop.com").should be_instance_of(Puppet::SSL::Certificate)
+ Puppet::SSL::Certificate.indirection.find("other.madstop.com").should be_instance_of(Puppet::SSL::Certificate)
+ Puppet::SSL::Certificate.indirection.find("luke.madstop.com").should be_instance_of(Puppet::SSL::Certificate)
end
it "should save the signed certificate to the :signeddir" do
@ca.sign("luke.madstop.com")
client_cert = File.join(Puppet[:signeddir], "luke.madstop.com.pem")
- File.read(client_cert).should == Puppet::SSL::Certificate.find("luke.madstop.com").content.to_s
+ File.read(client_cert).should == Puppet::SSL::Certificate.indirection.find("luke.madstop.com").content.to_s
end
it "should save valid certificates" do
diff --git a/spec/integration/ssl/certificate_request_spec.rb b/spec/integration/ssl/certificate_request_spec.rb
index 8426b9dc5..e04360548 100755
--- a/spec/integration/ssl/certificate_request_spec.rb
+++ b/spec/integration/ssl/certificate_request_spec.rb
@@ -50,13 +50,13 @@ describe Puppet::SSL::CertificateRequest do
@csr.generate(@key)
@csr.save
- Puppet::SSL::CertificateRequest.find("luke.madstop.com").should be_instance_of(Puppet::SSL::CertificateRequest)
+ Puppet::SSL::CertificateRequest.indirection.find("luke.madstop.com").should be_instance_of(Puppet::SSL::CertificateRequest)
end
it "should save the completely CSR when saving" do
@csr.generate(@key)
@csr.save
- Puppet::SSL::CertificateRequest.find("luke.madstop.com").content.to_s.should == @csr.content.to_s
+ Puppet::SSL::CertificateRequest.indirection.find("luke.madstop.com").content.to_s.should == @csr.content.to_s
end
end
diff --git a/spec/integration/ssl/host_spec.rb b/spec/integration/ssl/host_spec.rb
index 05862dfc4..c488eb229 100755
--- a/spec/integration/ssl/host_spec.rb
+++ b/spec/integration/ssl/host_spec.rb
@@ -45,7 +45,7 @@ describe Puppet::SSL::Host do
it "should save the key such that the Indirector can find it" do
@host.generate_key
- Puppet::SSL::Key.find(@host.name).content.to_s.should == @host.key.to_s
+ Puppet::SSL::Key.indirection.find(@host.name).content.to_s.should == @host.key.to_s
end
it "should save the private key into the :privatekeydir" do
@@ -62,7 +62,7 @@ describe Puppet::SSL::Host do
it "should save the certificate request such that the Indirector can find it" do
@host.generate_certificate_request
- Puppet::SSL::CertificateRequest.find(@host.name).content.to_s.should == @host.certificate_request.to_s
+ Puppet::SSL::CertificateRequest.indirection.find(@host.name).content.to_s.should == @host.certificate_request.to_s
end
it "should save the private certificate request into the :privatekeydir" do