开发者

where to put the unittest for library in rails

开发者 https://www.devze.com 2023-01-04 05:51 出处:网络
I am a ruby and rails newbie. And I am working on a rails application with R开发者_运维技巧adRails. RadRails has a \"Switch to Test\" function for my controller, model, etc. but not for my library. if

I am a ruby and rails newbie. And I am working on a rails application with R开发者_运维技巧adRails. RadRails has a "Switch to Test" function for my controller, model, etc. but not for my library. if I have class Foo::Bar in /lib/foo/bar.rb, where should I put the unittest for it?

or should I separate the foo library in a separated project?

Thanks.


for RSpec framework we put lib tests in spec/lib/.

if you use Test::Unit framework you can try to put your tests in test/lib/, and, if that not works, you can just drop them into test/unit/.

0

精彩评论

暂无评论...
验证码 换一张
取 消