Skip to content

Commit b0dc882

Browse files
committed
Spec tests for default_cache_enable behaviour. Correction in file content.
1 parent bcd4b3a commit b0dc882

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

spec/classes/mod/disk_cache_spec.rb

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@
103103
it { is_expected.to contain_class('apache::mod::cache').that_comes_before('Class[Apache::Mod::Disk_cache]') }
104104
it { is_expected.to contain_apache_mod('cache_disk') }
105105
it {
106-
is_expected.to contain_file('disk_cache.conf')
107-
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
108-
.to raise_error(Puppet::Error, 'default_cache_enable must be true or false')
106+
is_expected.to raise_error(Puppet::Error, 'default_cache_enable must be true or false')
109107
}
110108
end
111109
end
@@ -166,7 +164,7 @@
166164
it { is_expected.to contain_apache_mod('cache_disk') }
167165
it {
168166
is_expected.to contain_file('disk_cache.conf')
169-
.with(content: %r{CacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
167+
.with(content: %r{CacheRoot \"\/var\/cache\/httpd\/proxy\"\nCacheDirLevels 2\nCacheDirLength 1\n})
170168
}
171169
end
172170
context 'with $default_cache_enable = true' do
@@ -186,7 +184,7 @@
186184
it { is_expected.to contain_apache_mod('cache_disk') }
187185
it {
188186
is_expected.to contain_file('disk_cache.conf')
189-
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
187+
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/httpd\/proxy\"\nCacheDirLevels 2\nCacheDirLength 1\n})
190188
}
191189
end
192190
context 'with $default_cache_enable = foo' do
@@ -205,9 +203,7 @@
205203
it { is_expected.to contain_class('apache::mod::cache').that_comes_before('Class[Apache::Mod::Disk_cache]') }
206204
it { is_expected.to contain_apache_mod('cache_disk') }
207205
it {
208-
is_expected.to contain_file('disk_cache.conf')
209-
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
210-
.to raise_error(Puppet::Error, 'default_cache_enable must be true or false')
206+
is_expected.to raise_error(Puppet::Error, 'default_cache_enable must be true or false')
211207
}
212208
end
213209
end
@@ -273,7 +269,7 @@
273269
it { is_expected.to contain_apache_mod('cache_disk') }
274270
it {
275271
is_expected.to contain_file('disk_cache.conf')
276-
.with(content: %r{CacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
272+
.with(content: %r{CacheRoot \"\/var\/cache\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
277273
}
278274
end
279275
context 'with $default_cache_enable = true' do
@@ -293,7 +289,7 @@
293289
it { is_expected.to contain_apache_mod('cache_disk') }
294290
it {
295291
is_expected.to contain_file('disk_cache.conf')
296-
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
292+
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
297293
}
298294
end
299295
context 'with $default_cache_enable = foo' do
@@ -312,9 +308,7 @@
312308
it { is_expected.to contain_class('apache::mod::cache').that_comes_before('Class[Apache::Mod::Disk_cache]') }
313309
it { is_expected.to contain_apache_mod('cache_disk') }
314310
it {
315-
is_expected.to contain_file('disk_cache.conf')
316-
.with(content: %r{CacheEnable disk \/\nCacheRoot \"\/var\/cache\/apache2\/mod_cache_disk\"\nCacheDirLevels 2\nCacheDirLength 1\n})
317-
.to raise_error(Puppet::Error, 'default_cache_enable must be true or false')
311+
is_expected.to raise_error(Puppet::Error, 'default_cache_enable must be true or false')
318312
}
319313
end
320314
end

0 commit comments

Comments
 (0)