Skip to content

Commit

Permalink
Add test case for removed edge case handling in Cache.clear
Browse files Browse the repository at this point in the history
  • Loading branch information
rlue authored and thorsteneckel committed Jan 18, 2019
1 parent f84408d commit 2d5ec5d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/lib/cache_spec.rb
Expand Up @@ -86,7 +86,15 @@
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

0 comments on commit 2d5ec5d

Please sign in to comment.