Evaluating More Coverage in Ruby 3.2 - Kevin Murphy
19-Jan-2023 1034
As I mentioned in my prior post, Ruby 3.2.0 has some changes to the Coverage module. Now the module can measure the coverage of a Ruby expression in a string passed to the eval method.This is important because of templates. ERB, when we ask for the template through the result method, calls eval. When Rails is rendering a view, that also calls eval. More specifically, Rails calls the module_eval method.Have you wondered how much of the logic in your views is exercised in your test suite? Thanks to this change, now you can see that in tools like SimpleCov.
Evaluating More Coverage in Ruby 3.2 - Kevin Murphy #ruby #rubydeveloper #rubyonrails #Evaluating #Coverage #Kevin #Murphy https://rubyonrails.ba/link/evaluating-more-coverage-in-ruby-3-2-kevin-murphy