How does one write a spec for a Rails library? // Gregory
On 7/13/07, Gregory Murphy <Gregory.Murphy at sun.com> wrote:> How does one write a spec for a Rails library? >Umm, just like you would for any other Ruby library. Can you be more specific? Aslak> // Gregory > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
aslak hellesoy wrote:> On 7/13/07, Gregory Murphy <Gregory.Murphy at sun.com> wrote: >> How does one write a spec for a Rails library? >> > > Umm, just like you would for any other Ruby library. Can you be more > specific?Sorry, I''m referring in particular to RSpec for Rails. It generates a number of directories in a Rails app, with a place for model specs, for example, and a rake task to run them, e.g. ''rake spec:models''. But there is no place and no task for library tests. // Gregory
On 13 Jul 2007, at 20:31, Gregory Murphy wrote:> I''m referring in particular to RSpec for Rails. It generates a > number of directories in a Rails app, with a place for model specs, > for > example, and a rake task to run them, e.g. ''rake spec:models''. But > there > is no place and no task for library tests.Put them wherever you want -- most people seem to use spec/lib (cf http://rubyforge.org/pipermail/rspec-users/2007-June/002069.html). They''ll get run by "rake spec" along with everything else; add :libs to the "[:models, :controllers, :views, :helpers].each" line in vendor/plugins/rspec_on_rails/tasks/rspec.rake if you want to be able to say "rake spec:libs". Cheers, -Tom
On 7/13/07, Tom Stuart <tom at experthuman.com> wrote:> On 13 Jul 2007, at 20:31, Gregory Murphy wrote: > > I''m referring in particular to RSpec for Rails. It generates a > > number of directories in a Rails app, with a place for model specs, > > for > > example, and a rake task to run them, e.g. ''rake spec:models''. But > > there > > is no place and no task for library tests. > > Put them wherever you want -- most people seem to use spec/lib (cf > http://rubyforge.org/pipermail/rspec-users/2007-June/002069.html). > They''ll get run by "rake spec" along with everything else; add :libs > to the "[:models, :controllers, :views, :helpers].each" line in > vendor/plugins/rspec_on_rails/tasks/rspec.rake if you want to be able > to say "rake spec:libs". >Hey! That''s not for users to do! I''ve added it to rspec.rake ;-) Aslak> Cheers, > -Tom > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >