artsy / garner

A set of Rack middleware and cache helpers that implement various caching strategies.
MIT License
343 stars 24 forks source link

Document how to set up Rspec for testing #57

Open monfresh opened 11 years ago

monfresh commented 11 years ago

Please add documentation detailing what's needed to be able to run tests with Garner. Thanks!

monfresh commented 11 years ago

I think I figured it out. Tests are passing now after adding these 2 lines to my config.before(:each) block in spec_helper.rb:

Garner.config.reset!
Garner.config.cache.clear

Is this all that's needed? If so, I can submit a documentation pull request if you want.

fancyremarker commented 11 years ago

@monfresh: We actually clear the entire underlying cache (in our cache Rails.cache.clear), but your approach is more correct for the specific case of Garner. Yes, please submit a pull request and I'll merge. Thanks!