Skip to content

Commit c0554d7

Browse files
committed
Merge pull request #26 from pdxcat/fix_tests
Fix broken tests for ssl, vhost, vhost::*
2 parents 7b96288 + e62e362 commit c0554d7

File tree

4 files changed

+27
-18
lines changed

4 files changed

+27
-18
lines changed

spec/classes/ssl_spec.rb

+21-15
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,34 @@
22

33
describe 'apache::ssl', :type => :class do
44

5-
it { should include_class("apache") }
6-
it { should include_class("apache::params") }
5+
describe 'when running on an unsupported OS' do
6+
let(:facts) { {:operatingsystem => 'MagicUnicorn'} }
7+
it {
8+
expect {
9+
should raise_error(Puppet::Error, /not defined in apache::ssl/ )
10+
}
11+
}
12+
end
713

8-
describe "it should install the ssl package in redhat" do
9-
let :facts do
10-
{ :operatingsystem => 'redhat' }
11-
end
14+
describe 'when running on a supported OS' do
15+
let(:facts) { {:operatingsystem => 'redhat'} }
16+
it { should include_class('apache') }
17+
it { should include_class('apache::params') }
18+
end
1219

13-
it { should contain_package("apache_ssl_package").with(
20+
describe 'when running on redhat' do
21+
let(:facts) { {:operatingsystem => 'redhat'} }
22+
it {
23+
should contain_package('apache_ssl_package').with(
1424
'ensure' => 'installed'
1525
)
1626
}
1727
end
1828

19-
describe "it should contain a2mod ssl in debian" do
20-
let :facts do
21-
{ :operatingsystem => 'debian' }
22-
end
23-
24-
it { should contain_a2mod("ssl").with(
25-
'ensure' => 'present'
26-
)
29+
describe 'when running on debian' do
30+
let(:facts) { {:operatingsystem => 'debian'} }
31+
it {
32+
should contain_a2mod('ssl').with('ensure' => 'present')
2733
}
2834
end
2935

spec/defines/vhost/proxy_spec.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
'my_proxy_vhost'
77
end
88

9+
let :facts do
10+
{ :operatingsystem => 'redhat' }
11+
end
912

1013
let :default_params do
1114
{
@@ -51,7 +54,7 @@
5154
it { should contain_file("#{param_hash[:priority]}-#{title}").with({
5255
'owner' => 'root',
5356
'group' => 'root',
54-
'mode' => '755',
57+
'mode' => '0755',
5558
'require' => 'Package[httpd]',
5659
'notify' => 'Service[httpd]'
5760
})

spec/defines/vhost/redirect_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
it { should contain_file("#{param_hash[:priority]}-#{title}").with({
3939
'owner' => 'root',
4040
'group' => 'root',
41-
'mode' => '755',
41+
'mode' => '0755',
4242
'require' => 'Package[httpd]',
4343
'notify' => 'Service[httpd]'
4444
})

spec/defines/vhost_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
it { should contain_file("#{param_hash[:priority]}-#{title}.conf").with({
5858
'owner' => 'root',
5959
'group' => 'root',
60-
'mode' => '755',
60+
'mode' => '0755',
6161
'require' => 'Package[httpd]',
6262
'notify' => 'Service[httpd]'
6363
})

0 commit comments

Comments
 (0)