[rspec-users] Scaffolding Specs
dchelimsky at gmail.com
Tue Apr 17 22:48:10 EDT 2007
On 4/17/07, s.ross <cwdinfo at gmail.com> wrote:
> I just wrote a really simple tool that cranks out spec scaffolds for
> Rails apps. It's new and pretty simple, but you might find it useful:
Eclipse will do something like this for java. It's very helpful for
legacy code. The pitfall is that it tends to inspire newbies to write
one test method per method tested, and you end up w/ big tests that
take a method through a number of states.
I do like the descriptions you are generating: "should do something
sensible ...". That seems to be less like the typical test_index that
leads to the trouble I described above.
FYI - There is an RFE to be able to write:
it "should do something"
with no block and have that imply something pending; a to-do. I think
that would add value to this tool because you would generate a bunch
of spec stubs and rspec would tell you what you have yet to implement.
Also - in trunk, you need not say "controller_name" if you pass a type
instead of a String:
describe ContactController do
Thanks for sharing.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users