Test Rake Tasks

后端 未结 6 958
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-31 18:28

I am developing a ROR app that relies on many custom Rake tasks.

What is the best way to test them?

6条回答
  •  攒了一身酷
    2021-01-31 19:25

    Rake tasks are pretty hard to test. The easiest solution would be to move the logic into a method in an appropriate model. You can then test that and just call the method from the rake task.

提交回复
热议问题