Add test case for removed edge case handling in Cache.clear
This commit is contained in:
parent
f84408dfc3
commit
2d5ec5d485
1 changed files with 9 additions and 1 deletions
|
@ -86,7 +86,15 @@ RSpec.describe Cache do
|
||||||
Cache.write('123', 'some value')
|
Cache.write('123', 'some value')
|
||||||
Cache.clear
|
Cache.clear
|
||||||
|
|
||||||
expect { Cache.delete('123') }.not_to raise_error
|
expect { Cache.clear }.not_to raise_error
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when cache directory is not present on disk' do
|
||||||
|
before { FileUtils.rm_rf(Rails.cache.cache_path) }
|
||||||
|
|
||||||
|
it 'does not raise an error' do
|
||||||
|
expect { Cache.clear }.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue