开发者

Ruby on Rails Unit Testing

开发者 https://www.devze.com 2023-03-06 20:09 出处:网络
I\'m currently writing unit tests for my Ruby on Rails application, and one of my models is a normal Ruby class for parsing XML files.

I'm currently writing unit tests for my Ruby on Rails application, and one of my models is a normal Ruby class for parsing XML files. I now wish to write unit tests for this class using a correct and incorrect xml file. The only question is, where do I place these files inside the entire Ruby on Rails structure?

I can probably dump em anywhere I want, but I was wondering if there is some sort of convention on where to place them so that I can just call 'correct.xml' as path for the unit tests instead of specifying the enti开发者_如何学Cre path.


A good place to put your file is test\fixtures\assets


Since you writing a test cases for your model so better keep all test cases under the following directory.

Project\test\unit

0

精彩评论

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