Skip to content

Instantly share code, notes, and snippets.

@itspriddle
Created April 3, 2012 16:10
Show Gist options
  • Save itspriddle/2293241 to your computer and use it in GitHub Desktop.
Save itspriddle/2293241 to your computer and use it in GitHub Desktop.
module Cacher
def self.extended(base)
base.class_eval do
before do
if subject.respond_to?(:caches_action) && cache_path = example.metadata[:cache]
subject.caches_action cache_path
end
end
end
end
end
RSpec.configure do |c|
c.extend Cacher, :type => :controller
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment