Search code examples
ruby-on-railsrubycode-coveragehamlrcov

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 structure.

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


Solution

  • 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.