Add test case for removed edge case handling in Cache.clear

This commit is contained in:
Ryan Lue 2019-01-15 17:12:44 +08:00 committed by Thorsten Eckel
parent f84408dfc3
commit 2d5ec5d485

View file

@ -86,7 +86,15 @@ RSpec.describe Cache do
Cache.write('123', 'some value')
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