开发者

Code coverage tools for haml?

It looks like it's quite possible to get a useful coverage report for Haml code, due to its one one-statement-per-line st开发者_如何转开发ructure.

Do you know of any code coverage tools for Haml? Maybe something is in the works?


Code coverage generally makes sure you cover all your code-paths. If you have a lot of logic in your view, that is a smell. I think logic should be moved to your helpers, controllers (render a different view) or presenters, and those you can test with perfect coverage.

Aside of that: theoretically it should be possible, but i would not want to encourage placing too much "intelligence" in views.


One problem with non-mainstream languages (such as HAML) is that tools are hard to find, because they are hard to build.

This technical paper Branch Coverage for Arbitrary Languages Made Easy (I'm the author) describes how to build test coverage tools for langauges in systematic way to help get around this problem, using a generic tool-building infrastructure.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜