On 10/19/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > >> Another alternative combining your suggestion with what Pat > >> mentioned: > >> > >> step_matchers do |match| > >> match.given ... > >> match.when ... > >> match.then ... > >> end > > > > That's nice, except we don't want methods named when and then as they > > are keywords :( > > Even so, it still works. Ruby is smart enough to figure out that when > "when" and "then" appear after a period, then they're actually > message sends: > > irb> class Foo > irb> def when > irb> puts "hello world" > irb> end > irb> end > => nil > irb> Foo.new.when > hello world > => nil > > Or is there some other complication that I'm not aware of?
You won't be able to use a case statement in the match object. That might be OK, but it's a bit weird. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users