[rspec-users] Preconditions

Geoffrey Wiseman geoffrey.wiseman at gmail.com
Fri Sep 7 21:36:30 EDT 2007


On 9/7/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> > Actually, on that note -- what's the normal way to share a setup across
> > multiple behaviors, a helper method in an includeable module?
>
> You can include callable methods in modules, but they have to be
> called from within the spec.
>
> Alternative is shared behaviours:
> http://rspec.rubyforge.org/documentation/index.html (scroll down a
> bit).


I've already got some shared behaviors, they're great; nice way to use a
unit-level assertions n higher-level tests for instance without breaking
DRY.

Hadn't really thought about using these just for setup; the syntax would
look a little weird what with it_should_behave_like, but it's still a
thought.

-- 
Geoffrey Wiseman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070907/ed50da40/attachment.html 


More information about the rspec-users mailing list