[rspec-users] WDYT, simple, anonymous story listeners?

aslak hellesoy aslak.hellesoy at gmail.com
Wed Aug 13 08:29:11 EDT 2008


On Wed, Aug 13, 2008 at 2:25 AM, 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?
>

As mentioned earlier on the RSpec development list, we're considering
replacing the Story runner with a new implementation:

http://github.com/aslakhellesoy/cucumber
http://gojko.net/2008/08/06/cucumber-next-generation-ruby-bdd-tool/
http://www.nabble.com/-ANN--Cucumber-td18876816.html

I'd rather see a similar construct for Cucumber, which already is
(IMHO) much better than the Story Runner.

Before(:all) do
end

After(:all) do
end

(per-scenarion Before/After is already implemented).

Aslak

> 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| }
> )
>
>
> --
> Zach Dennis
> http://www.continuousthinking.com
> http://www.mutuallyhuman.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list