summaryrefslogtreecommitdiffstats
path: root/spec/unit/ssl
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-05-12 18:25:14 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitac7efc8f0284d6b35f5428da06ba371cf94998ec (patch)
treec1a6a6df5dd2d533c1d0b12b869a0758b8c4cb6f /spec/unit/ssl
parent5665e3984f73c70b90f65dd8bf4445b5adda5121 (diff)
downloadpuppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.tar.gz
puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.tar.xz
puppet-ac7efc8f0284d6b35f5428da06ba371cf94998ec.zip
Feature #2935 Puppet::Mode#master?
Use a predicate function on the Mode object instead of comparing with the executable name everywhere Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'spec/unit/ssl')
-rwxr-xr-xspec/unit/ssl/certificate_authority.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/ssl/certificate_authority.rb b/spec/unit/ssl/certificate_authority.rb
index 4d2303a60..3b1b9486f 100755
--- a/spec/unit/ssl/certificate_authority.rb
+++ b/spec/unit/ssl/certificate_authority.rb
@@ -24,10 +24,10 @@ describe Puppet::SSL::CertificateAuthority do
end
describe "when finding an existing instance" do
- describe "and the host is a CA host and the proces name is 'puppetmasterd'" do
+ describe "and the host is a CA host and the mode is master" do
before do
Puppet.settings.stubs(:value).with(:ca).returns true
- Puppet.settings.stubs(:value).with(:name).returns "puppetmasterd"
+ Puppet.mode.stubs(:master?).returns true
@ca = mock('ca')
Puppet::SSL::CertificateAuthority.stubs(:new).returns @ca
@@ -45,7 +45,7 @@ describe Puppet::SSL::CertificateAuthority do
describe "and the host is not a CA host" do
it "should return nil" do
Puppet.settings.stubs(:value).with(:ca).returns false
- Puppet.settings.stubs(:value).with(:name).returns "puppetmasterd"
+ Puppet.mode.stubs(:master?).returns true
ca = mock('ca')
Puppet::SSL::CertificateAuthority.expects(:new).never
@@ -53,10 +53,10 @@ describe Puppet::SSL::CertificateAuthority do
end
end
- describe "and the process name is not 'puppetmasterd'" do
+ describe "and the mode is not master" do
it "should return nil" do
Puppet.settings.stubs(:value).with(:ca).returns true
- Puppet.settings.stubs(:value).with(:name).returns "puppetd"
+ Puppet.mode.stubs(:master?).returns false
ca = mock('ca')
Puppet::SSL::CertificateAuthority.expects(:new).never