# New Gem: Rspec custom matchers for action caching

**URL:** <https://www.ruby-forum.com/t/new-gem-rspec-custom-matchers-for-action-caching/194635>\
**Category:** Rails\
**Created:** [September 8, 2010, 9:06am UTC](https://www.ruby-forum.com/t/new-gem-rspec-custom-matchers-for-action-caching/194635 "2010-09-08T09:06:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolframarnold](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a88e57/32.png) [@wolframarnold](https://www.ruby-forum.com/u/wolframarnold)\
**Post date:** [September 8, 2010, 9:06am UTC](https://www.ruby-forum.com/t/new-gem-rspec-custom-matchers-for-action-caching/194635/1 "2010-09-08T09:06:44Z")

</div>

I’ve released a gem that lets you assert in rspec whether a given action  
or fragment has been cached. It works with memcached only.

Example:

lambda {  
get :index  
}.should be\_cached(controller, :action =\> ‘index’)

Available at:  
[http://rubygems.org/gems/caching\_matcher](http://rubygems.org/gems/caching_matcher)

Github:

> **[GitHub - mightyverse/caching\_matcher: custom rspec matcher for testing matching](https://github.com/mightyverse/caching_matcher)**
>
> custom rspec matcher for testing matching. Contribute to mightyverse/caching\_matcher development by creating an account on GitHub.

Please check it out.

Best,

Wolf

---

<div class="post-metadata">

**Author:** ![wolframarnold](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/a88e57/32.png) [@wolframarnold](https://www.ruby-forum.com/u/wolframarnold)\
**Post date:** [September 8, 2010, 9:13am UTC](https://www.ruby-forum.com/t/new-gem-rspec-custom-matchers-for-action-caching/194635/2 "2010-09-08T09:13:01Z")

</div>

Congratulations!!

Me and new stuff are like a door and its frame (they are always  
together). I  
getting it right for trial!!

* * *

Edmond  
Software Developer | Baobab Health Trust ([http://www.baobabhealth.org/](http://www.baobabhealth.org/))  
|  
Malawi

Cell: +265 999 465 137 | +265 881 234 717

_“Many people doubt open source software and probably donâ€™t realize that  
there is an alternativeâ€¦ which is just as good…” – Kevin Scannell_

Le 8 septembre 2010 09:06:44 UTC+2, Wolfram Arnold  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) a  
Ã©crit :
