On Fri, Jul 31, 2009 at 4:36 AM, David Chelimsky<dchelim...@gmail.com> wrote:
> On Fri, Jul 31, 2009 at 2:11 AM, Brian Takita<brian.tak...@gmail.com> wrote:
>> I think I would like to stick primarily with Rspec, because I like
>> working close to the code and being able to easily refactor things.
>> I do like Cucumber's ability to easily define sequences of actions and
>> custom plain text actions.
>>
>> Here are some api ideas I have to make those things better in rspec.
>> http://gist.github.com/159123
>>
>> WDYT?
>
> Very cool ideas. I'm not sure whether I'd want them in rspec proper,
> but I do think that rspec should let you easily plug ideas like this
> into its example lifecycle management. That idea has been brewing for
> a while as part of rspec-2.0, but rspec-2.0 is back-burnered until
> after the book is off to print - I need to stay focused.
>
> What you're proposing looks a lot like rbehave, which was the
> precursor to Story Runner, and then Cucumber. Story Runner introduced
> plain text scenarios, but still let you work in Ruby (like rbehave) if
> you chose to. In rbehave, your example would look like
> http://gist.github.com/159174
>
> FIT's DoFixture does the same sort of alternating part of the method
> with arguments. So you can write table rows like this:
>
> | can have | any | number of | arguments | between text |
>
> .. which get converted to method calls like this (pardon the camel case):
>
> canHaveNumberOfBetweenText('any','arguments')
>
> This actually dates back to smalltalk, which lets you make method
> calls with something akin to keyword arguments like this:
>
> message canHave: 'any'; numberOf: 'arguments'
These sort of apis almost always mirror the problem at hand more closely.
>
> It's more fluid than rbehave's name/arg structure, in which all of the
> args have to be at the end, and I think its a powerful idea. The
> lambda in the middle is a bit disconcerting. Maybe that bit would look
> nicer in Ruby 1.9 :)
I actually use lambdas quite a bit in my macro invocations because the
code inside needs to be executed in the context of the Example. I like
the idea of using L as the lambda method. I think its a convention
that is worth having.
>
> Other thoughts?
I'm very much in support of a strong and simple core object model in
which a nice DSLish api can be built on top of. I think this would
open up innovation in making good api's, since each implementer would
not need to develop so much infrastructure.

It would also be cool to bring the Cucumber and rspec world closer together.
>
> Cheers,
> David
Cheers,
Brian
>
>>
>> - Brian
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
> _______________________________________________
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to