|
35 | 35 | it { |
36 | 36 | is_expected.to contain_file('/etc/apache2/sites-enabled').with( |
37 | 37 | 'ensure' => 'directory', 'recurse' => 'true', |
38 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
39 | | - 'require' => 'Package[httpd]' |
40 | | - ) |
| 38 | + 'purge' => 'true' |
| 39 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
41 | 40 | } |
42 | 41 | it { |
43 | 42 | is_expected.to contain_file('/etc/apache2/mods-enabled').with( |
44 | 43 | 'ensure' => 'directory', 'recurse' => 'true', |
45 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
46 | | - 'require' => 'Package[httpd]' |
47 | | - ) |
| 44 | + 'purge' => 'true' |
| 45 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
48 | 46 | } |
49 | 47 | it { |
50 | 48 | is_expected.to contain_file('/etc/apache2/mods-available').with( |
51 | 49 | 'ensure' => 'directory', 'recurse' => 'true', |
52 | | - 'purge' => 'false', 'notify' => 'Class[Apache::Service]', |
53 | | - 'require' => 'Package[httpd]' |
54 | | - ) |
| 50 | + 'purge' => 'false' |
| 51 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
55 | 52 | } |
56 | 53 | it { |
57 | 54 | is_expected.to contain_concat('/etc/apache2/ports.conf').with( |
58 | 55 | 'owner' => 'root', 'group' => 'root', |
59 | | - 'mode' => '0644', 'notify' => 'Class[Apache::Service]' |
60 | | - ) |
| 56 | + 'mode' => '0644' |
| 57 | + ).that_notifies('Class[Apache::Service]') |
61 | 58 | } |
62 | 59 | # Assert that load files are placed and symlinked for these mods, but no conf file. |
63 | 60 | ['auth_basic', 'authn_file', 'authz_default', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname| |
|
313 | 310 | it { |
314 | 311 | is_expected.to contain_file('/etc/httpd/conf.d').with( |
315 | 312 | 'ensure' => 'directory', 'recurse' => 'true', |
316 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
317 | | - 'require' => 'Package[httpd]' |
318 | | - ) |
| 313 | + 'purge' => 'true' |
| 314 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
319 | 315 | } |
320 | 316 | it { |
321 | 317 | is_expected.to contain_concat('/etc/httpd/conf/ports.conf').with( |
322 | 318 | 'owner' => 'root', 'group' => 'root', |
323 | | - 'mode' => '0644', 'notify' => 'Class[Apache::Service]' |
324 | | - ) |
| 319 | + 'mode' => '0644' |
| 320 | + ).that_notifies('Class[Apache::Service]') |
325 | 321 | } |
326 | 322 | describe 'Alternate confd/mod/vhosts directory' do |
327 | 323 | let :params do |
|
336 | 332 | it { |
337 | 333 | is_expected.to contain_file("/etc/httpd/#{dir}").with( |
338 | 334 | 'ensure' => 'directory', 'recurse' => 'true', |
339 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
340 | | - 'require' => 'Package[httpd]' |
341 | | - ) |
| 335 | + 'purge' => 'true' |
| 336 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
342 | 337 | } |
343 | 338 | end |
344 | 339 |
|
|
508 | 503 |
|
509 | 504 | it { |
510 | 505 | is_expected.to contain_file('/opt/rh/root/etc/httpd/conf/httpd.conf').with( |
511 | | - 'ensure' => 'file', |
512 | | - 'notify' => 'Class[Apache::Service]', |
513 | | - 'require' => ['Package[httpd]', 'Concat[/etc/httpd/conf/ports.conf]'], |
514 | | - ) |
| 506 | + 'ensure' => 'file', |
| 507 | + ).that_notifies('Class[Apache::Service]').that_requires(['Package[httpd]', 'Concat[/etc/httpd/conf/ports.conf]']) |
515 | 508 | } |
516 | 509 | end |
517 | 510 |
|
|
523 | 516 | it { |
524 | 517 | is_expected.to contain_file('/etc/httpd/special_conf.d').with( |
525 | 518 | 'ensure' => 'directory', 'recurse' => 'true', |
526 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
527 | | - 'require' => 'Package[httpd]' |
528 | | - ) |
| 519 | + 'purge' => 'true' |
| 520 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
529 | 521 | } |
530 | 522 | end |
531 | 523 |
|
|
729 | 721 | it { |
730 | 722 | is_expected.to contain_file('/usr/local/etc/apache24/Vhosts').with( |
731 | 723 | 'ensure' => 'directory', 'recurse' => 'true', |
732 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
733 | | - 'require' => 'Package[httpd]' |
734 | | - ) |
| 724 | + 'purge' => 'true' |
| 725 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
735 | 726 | } |
736 | 727 | it { |
737 | 728 | is_expected.to contain_file('/usr/local/etc/apache24/Modules').with( |
738 | 729 | 'ensure' => 'directory', 'recurse' => 'true', |
739 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
740 | | - 'require' => 'Package[httpd]' |
741 | | - ) |
| 730 | + 'purge' => 'true' |
| 731 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
742 | 732 | } |
743 | 733 | it { |
744 | 734 | is_expected.to contain_concat('/usr/local/etc/apache24/ports.conf').with( |
745 | 735 | 'owner' => 'root', 'group' => 'wheel', |
746 | | - 'mode' => '0644', 'notify' => 'Class[Apache::Service]' |
747 | | - ) |
| 736 | + 'mode' => '0644' |
| 737 | + ).that_notifies('Class[Apache::Service]') |
748 | 738 | } |
749 | 739 | # Assert that load files are placed for these mods, but no conf file. |
750 | 740 | ['auth_basic', 'authn_core', 'authn_file', 'authz_groupfile', 'authz_host', 'authz_user', 'dav', 'env'].each do |modname| |
|
798 | 788 | it { |
799 | 789 | is_expected.to contain_file('/etc/apache2/vhosts.d').with( |
800 | 790 | 'ensure' => 'directory', 'recurse' => 'true', |
801 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
802 | | - 'require' => 'Package[httpd]' |
803 | | - ) |
| 791 | + 'purge' => 'true' |
| 792 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
804 | 793 | } |
805 | 794 | it { |
806 | 795 | is_expected.to contain_file('/etc/apache2/modules.d').with( |
807 | 796 | 'ensure' => 'directory', 'recurse' => 'true', |
808 | | - 'purge' => 'true', 'notify' => 'Class[Apache::Service]', |
809 | | - 'require' => 'Package[httpd]' |
810 | | - ) |
| 797 | + 'purge' => 'true' |
| 798 | + ).that_notifies('Class[Apache::Service]').that_requires('Package[httpd]') |
811 | 799 | } |
812 | 800 | it { |
813 | 801 | is_expected.to contain_concat('/etc/apache2/ports.conf').with( |
814 | 802 | 'owner' => 'root', 'group' => 'wheel', |
815 | | - 'mode' => '0644', 'notify' => 'Class[Apache::Service]' |
816 | | - ) |
| 803 | + 'mode' => '0644' |
| 804 | + ).that_notifies('Class[Apache::Service]') |
817 | 805 | } |
818 | 806 | end |
819 | 807 | context 'on all OSes' do |
|
838 | 826 |
|
839 | 827 | it { |
840 | 828 | is_expected.to contain_package('httpd').with( |
841 | | - 'notify' => 'Class[Apache::Service]', |
842 | 829 | 'ensure' => 'installed', |
843 | 830 | 'name' => 'httpd24-httpd', |
844 | | - ) |
| 831 | + ).that_notifies('Class[Apache::Service]') |
845 | 832 | } |
846 | 833 | end |
847 | 834 | context 'with a custom file_mode parameter' do |
|
919 | 906 | is_pe: false } |
920 | 907 | end |
921 | 908 |
|
922 | | - it do |
923 | | - expect { |
924 | | - catalogue |
925 | | - }.to raise_error(Puppet::Error, %r{Unsupported osfamily}) |
926 | | - end |
| 909 | + it { is_expected.to compile.and_raise_error(%r{Unsupported osfamily}) } |
927 | 910 | end |
928 | 911 | end |
0 commit comments