[rspec-devel] changes to Story Runner steps

Dan North tastapod at gmail.com
Mon Oct 29 12:08:07 EDT 2007

Hi there.

Just catching up with the rspec lists. It looks like this happened only five
days ago, which is a lifetime in rspec trunk terms :)

Briefly, I'm loving what I'm seeing. David: you have very much captured the
flavour of what we discussed with groups and groups-of-groups. It's possible
the words will change, but the idea in principle is exactly right.
(Translation: people using trunk may find we go through a couple of
iterations of different method names and/or structures before it settles

Great stuff.


On 10/24/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 10/24/07, Josh Chisholm <joshuachisholm at gmail.com> wrote:
> > 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
> Possible, yes. Wrong, no. Does that mean we should? Maybe. Maybe not.
> First - we'll be doing something more in line with the rest of RSpec
> to hide the SpecMatcher class. Dan and I have been batting this around
> and I'm leaning towards something like this (Dan, please comment if
> you're reading this):
> steps_for :accounts do
>   Given "my savings account balance is $balance" do |balance|
>     @savings_account = Account.new(balance.to_f)
>   end
> end
> Keep in mind that Ruby stories won't go away, so this means that
> whether you're defining steps for a tag (more on that below) or
> defining a Story in Ruby, you use the same Given/When/Then syntax.
> While it would be sexy to bend String to our will as in your proposal,
> I think this consistency is going to be important.
> The tags would replace the need for defining subclasses of StepGroup.
> In rake-like fashion, we can nest groups of steps like this:
> steps_for :interest_bearing_accounts => [:accounts] do
>   Given "my interest rate is $rate" { |rate| ... }
> end
> Then we could use them like this (not yet - this is all hypothetical):
> using_steps_for :login, :navigation, :accounts do
>   run 'path/to/story'
> end
> Thoughts?
> David
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20071029/73c213d3/attachment-0001.html 

More information about the rspec-devel mailing list