On 10/18/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote:
> El 18/10/2007, a las 10:33, "David Chelimsky" <[EMAIL PROTECTED]>
> escribió:
>
> > Take a look at examples/story/calculator.rb to see what's going on.
> >
> > Needs docs!!!!
> >
> > Thoughts welcome.
>
> Could this:
>
> step_matcher(:given, "an addend of $addend") do |addend|
> @adder ||= Adder.new
> @adder << addend.to_i
> end
>
> step_matcher(:when, "they are added") do
> @sum = @adder.sum
> end
>
> step_matcher(:then, "the sum should be $sum") do |sum|
> @sum.should == sum.to_i
> end
>
> Be refactored to this?
>
> given_matcher("an addend of $addend") do |addend|
> @adder ||= Adder.new
> @adder << addend.to_i
> end
>
> when_matcher("they are added") do
> @sum = @adder.sum
> end
>
> then_matcher("the sum should be $sum") do |sum|
> @sum.should == sum.to_i
> end
>
> I'd find that a little bit easier to type; what do you think?
Easier to type, sure. I'm not in love w/ the names yet though because
they sound like verb phrases - "given matcher", "when matcher", "then
matcher".
How about something like match_given, match_when, match_then?
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users