3 # This function is called inside the OS specific contexts
4 def general_mime_magic_specs
5 it { is_expected.to contain_apache__mod("mime_magic") }
8 describe 'apache::mod::mime_magic', :type => :class do
13 context "On a Debian OS with default params" do
16 :osfamily => 'Debian',
17 :operatingsystemrelease => '6',
18 :concat_basedir => '/dne',
19 :lsbdistcodename => 'squeeze',
20 :operatingsystem => 'Debian',
23 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
28 general_mime_magic_specs()
31 is_expected.to contain_file("mime_magic.conf").with_content(
32 "MIMEMagicFile \"/etc/apache2/magic\"\n"
36 it { is_expected.to contain_file("mime_magic.conf").with({
38 :path => '/etc/apache2/mods-available/mime_magic.conf',
40 it { is_expected.to contain_file("mime_magic.conf symlink").with({
42 :path => '/etc/apache2/mods-enabled/mime_magic.conf',
45 context "with magic_file => /tmp/Debian_magic" do
47 { :magic_file => "/tmp/Debian_magic" }
51 is_expected.to contain_file("mime_magic.conf").with_content(
52 "MIMEMagicFile \"/tmp/Debian_magic\"\n"
59 context "on a RedHat OS with default params" do
62 :osfamily => 'RedHat',
63 :operatingsystemrelease => '6',
64 :concat_basedir => '/dne',
65 :operatingsystem => 'RedHat',
68 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
73 general_mime_magic_specs()
76 is_expected.to contain_file("mime_magic.conf").with_content(
77 "MIMEMagicFile \"/etc/httpd/conf/magic\"\n"
81 it { is_expected.to contain_file("mime_magic.conf").with_path("/etc/httpd/conf.d/mime_magic.conf") }
85 context "with magic_file => /tmp/magic" do
88 :osfamily => 'Debian',
89 :operatingsystemrelease => '6',
90 :concat_basedir => '/dne',
91 :lsbdistcodename => 'squeeze',
92 :operatingsystem => 'Debian',
95 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
101 { :magic_file => "/tmp/magic" }
105 is_expected.to contain_file("mime_magic.conf").with_content(
106 "MIMEMagicFile \"/tmp/magic\"\n"