Rails: How to test code in the lib/ directory?

前端 未结 7 1508

I have a model which gets its data from a parser object. I\'m thinking that the parser class should live in the lib/ directory (although I could be persuaded that it should live

7条回答
  •  北荒
    北荒 (楼主)
    2021-01-30 07:11

    To not define additional rake tasks to run tests from the custom defined folders you may also run them with the command rake test:all. Tests folders structure for the lib folder or any other custom folder is up to you. But I prefer to duplicate them in classes: lib is matched to test/lib, app/form_objects to test/form_objects.

提交回复
热议问题