Kelly Felkins
2006-Jul-23 15:22 UTC
[Rails] Recommendations for managing tests for non-models and non-controllers in rails?
I''ve got unit tests for a class library that I''m using in a rails project. Currently this is the only project using this library so I would like to keep the classes and tests in the rails project. I moved the classes under [app]/lib. I currently have the tests in [app]/test. It would be great if these tests were run every time I run ''rake''. What is everyone else doing for this? -Kelly -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/0bef41d9/attachment.html
Eric Kidd
2006-Jul-23 15:36 UTC
[Rails] Recommendations for managing tests for non-models and non-controllers in rails?
On Jul 23, 2006, at 11:22 AM, Kelly Felkins wrote:> I''ve got unit tests for a class library that I''m using in a rails > project. Currently this is the only project using this library so I > would like to keep the classes and tests in the rails project. I > moved the classes under [app]/lib. I currently have the tests in > [app]/test. > > It would be great if these tests were run every time I run ''rake''. > What is everyone else doing for this?I put my classes in ./lib and my tests in ./tests/unit. There''s no reason why unit tests should be limited to stuff in ./app/models, as far as I can see. :-) Cheers, Eric
Kelly Felkins
2006-Jul-23 15:48 UTC
[Rails] Recommendations for managing tests for non-models and non-controllers in rails?
Ah, good point. I developed the lib using zentest/autotest, which places the test at the beginning of the name of of the test -- test_something.rb. Rails, or at least the rake targets for testing seem to want it at the end -- something_test.rb. Once I changed the names ''rake test:units'' found the tests and ran them. -Kelly On 7/23/06, Eric Kidd <emk.lists@gmail.com> wrote:> > > On Jul 23, 2006, at 11:22 AM, Kelly Felkins wrote: > > I''ve got unit tests for a class library that I''m using in a rails > > project. Currently this is the only project using this library so I > > would like to keep the classes and tests in the rails project. I > > moved the classes under [app]/lib. I currently have the tests in > > [app]/test. > > > > It would be great if these tests were run every time I run ''rake''. > > What is everyone else doing for this? > > I put my classes in ./lib and my tests in ./tests/unit. There''s no > reason why unit tests should be limited to stuff in ./app/models, as > far as I can see. :-) > > Cheers, > Eric > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060723/b0f9f347/attachment-0001.html
Seemingly Similar Threads
- wrong id for activerecord object when using :joins in mysql
- is there really a restart task in switchtower? How do you invoke it?
- Does shared hosting work? Anywhere?
- Does your *shared* hosting account work without errors?
- inexpensive ways to make a rails application highly available? mysql replication?