[rspec-users] named context or calling include_context with block?

Christopher J. Bottaro cjbottaro at gmail.com
Fri Aug 5 13:55:55 EDT 2011


I'm playing around with Rspec again after going from test/unit to
rspec then back to test/unit... :)  Right off the bat, I find myself
wanting to do something like this:  https://gist.github.com/1128091

Basically, I want to name a context, then call it later by name,
passing a block to it.

Or in other words... what is the best way to DRY this code?

Is that possible in Rspec 2.6?  If not, can anyone provide a monkey
patch for me?  Thanks!

More information about the rspec-users mailing list