Updated

spec/support / memcache.rb

A
16 lines of codes
1 methods
13.7 complexity/method
1 churn
13.67 complexity
0 duplications
RSpec.configure do |config| helpers = Module.new do def without_cache(key, options = {}, &block)
  1. without_cache doesn't depend on instance state (maybe move it to another class?)
value = Rails.cache.read(key)
  1. without_cache calls 'Rails.cache' 4 times Locations: 0 1 2 3
Rails.cache.delete(key)
  1. without_cache calls 'Rails.cache' 4 times Locations: 0 1 2 3
  2. without_cache calls 'Rails.cache.delete(key)' 2 times Locations: 0 1
yield ensure Rails.cache.delete(key)
  1. without_cache calls 'Rails.cache' 4 times Locations: 0 1 2 3
  2. without_cache calls 'Rails.cache.delete(key)' 2 times Locations: 0 1
Rails.cache.write(key, value, options)
  1. without_cache calls 'Rails.cache' 4 times Locations: 0 1 2 3
end end config.include helpers end