[rspec-users] WDYT, simple, anonymous story listeners?
David Chelimsky
dchelimsky at gmail.com
Tue Aug 12 21:25:25 EDT 2008
On Tue, Aug 12, 2008 at 7:25 PM, Zach Dennis <zach.dennis at gmail.com> wrote:
> Sometimes I don't have a full need to make a class to do something,
> yet I want something readable and concise. This is influenced from the
> joys of JavaScript.
>
> Today I made this happen. Love it, like it, hate it, WDYT?
>
> Spec::Story::Runner.register_listener FunctionalStruct.new(
> :run_started => lambda { |*args|
> Generate.user(:login => "normal user")
> },
> :run_ended => lambda { |*args|
> User.destroy_all
> },
> :method_missing => lambda { |*a| }
> )
Love is a bit strong. Like++
More information about the rspec-users
mailing list