[rspec-devel] changes to Story Runner steps

Josh Chisholm joshuachisholm at gmail.com
Wed Oct 24 04:58:35 EDT 2007


Hi David,

I don't know if this is still open for discussion, but would it be
wrong (or possible) to take the first word of the matcher itself to
determine its type? e.g:

steps = StepGroup.new do
  steps do
     "given my savings account balance is $balance".means do |balance|
         @savings_account = Account.new(balance.to_f)
      end
  end
end


On 10/24/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> Hi all,
>
> The following only affects people who have bravely begun to experiment
> with the 2 day-old plain text story runner and definable groups of
> steps.
>
> For those who fit that bill, I just committed a few changes that will
> require you to make changes to your code.
>
> The StepMatchers class is now the StepGroup class.
>
> The step_matchers methods on PlainTextStoryRunner and StepGroup is now
> just steps. So instead of defining a group like this:
>
> # old - no longer supported
> matchers = StepMatchers.new do
>   step_matchers do |add|
>     add.given(...) {...}
>   end
> end
>
> # new
> steps = StepGroup.new do
>   steps do |add|
>     add.given(...) {...}
>   end
> end
>
> And actually, I've tried 'define' instead of 'add' for the block arg
> and it speaks pretty nicely:
>
> steps = StepGroup.new do
>   steps do |define|
>     define.given(...) {...}
>   end
> end
>
> There will be more changes coming over the next few days. Just a heads up.
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the rspec-devel mailing list