[rspec-devel] experimental rails story adapter in trunk

David Chelimsky dchelimsky at gmail.com
Sun Sep 2 04:31:23 EDT 2007


On 8/30/07, dan at tastapod.com <dan at tastapod.com> wrote:
> > For those of you interested in getting a jump on learning about and
> > using the new Story Runner in a Rails app, I've added an experimental
> > Rails-Story adapter to trunk.
> >
> > You can see how to use it here:
> >
> > http://pastie.caboo.se/92320
> >
> > This is PURELY EXPERIMENTAL, however it actually works and will likely
> > not change much in the way that it does work.
> >
> > Happy hacking!
> >
> > David
>
> I tidied it up a bit - there were some parameters that weren't being used
> as parameters. It's now at http://pastie.caboo.se/92472.
>
> Also, I'm wondering (out loud) whether you can do this:
>
> When "creating a new person with no name" do
>   When "creating a new person named", nil
> end

I'm not a big fan of this nesting w/ When, but if it used a verb of
some sort I might like it -

When "creating a new person with no name" do
 Exec "creating a new person named", nil
 Do "creating a new person named", nil
 Run "creating a new person named", nil
 Invoke "creating a new person named", nil
 Call "creating a new person named", nil
end

Not sure about any of those, but you get the idea.

>
> It _feels_ like it should work. Can't see why it wouldn't. Better yet, you
> could have a method:
>
> def create_person(name)
>   post "/people/create", :person => {:name => name}
> end
>
> at the Story or Scenario level and call it from both Whens.

That seems the better choice to me.

>
> Cheers,
> Dan
>
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the rspec-devel mailing list