Volkan Unsal
2010-Nov-21 01:07 UTC
[rspec-users] How do I generate specs for existing controllers?
I want to generate boilerplate code for existing controller, models and views. Is there a command or a gem that lets me do that?
Evgeniy Dolzhenko
2010-Nov-25 13:06 UTC
[rspec-users] How do I generate specs for existing controllers?
Unfortunately no that I know of, though it shouldn''t be very hard to write a script for that which will rely on running corresponding generators with `-s, [--skip]` options which makes the generator skip already existing files. On Sun, Nov 21, 2010 at 4:07 AM, Volkan Unsal <spocksplanet at gmail.com> wrote:> I want to generate boilerplate code for existing controller, models > and views. Is there a command or a gem that lets me do that? > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Chelimsky
2010-Nov-25 14:20 UTC
[rspec-users] How do I generate specs for existing controllers?
On Nov 20, 2010, at 7:07 PM, Volkan Unsal wrote:> I want to generate boilerplate code for existing controller, models > and views. Is there a command or a gem that lets me do that?You can''t see them because rails hides them, but: rails generate rspec:model rails generate rspec:view rails generate rspec:controller Each of these generates only the spec. HTH, David
Jonathan Linowes
2010-Nov-25 14:33 UTC
[rspec-users] How do I generate specs for existing controllers?
rails hides them? why? On Nov 25, 2010, at 9:20 AM, David Chelimsky wrote:> On Nov 20, 2010, at 7:07 PM, Volkan Unsal wrote: > >> I want to generate boilerplate code for existing controller, models >> and views. Is there a command or a gem that lets me do that? > > You can''t see them because rails hides them, but: > > rails generate rspec:model > rails generate rspec:view > rails generate rspec:controller > > Each of these generates only the spec. > > HTH, > David > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky
2010-Nov-25 17:17 UTC
[rspec-users] How do I generate specs for existing controllers?
On Nov 25, 2010, at 8:33 AM, Jonathan Linowes wrote:> On Nov 25, 2010, at 9:20 AM, David Chelimsky wrote: > >> On Nov 20, 2010, at 7:07 PM, Volkan Unsal wrote: >> >>> I want to generate boilerplate code for existing controller, models >>> and views. Is there a command or a gem that lets me do that? >> >> You can''t see them because rails hides them, but:> rails hides them? > > why?Rails 3 agnosticism. Intent is that when you register rspec as "the test framework" that the Rails generators ("rails generate model", etc) seamlessly delegate the test-generation to rspec. It''s not really designed with generating tests after the fact in mind.>> rails generate rspec:model >> rails generate rspec:view >> rails generate rspec:controller >> >> Each of these generates only the spec. >> >> HTH, >> David >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users