Generated autotest/merb_rspec.rb file is broken
Reported by Stephen Eley | December 31st, 2008 @ 02:42 PM
The generated class Autotest::MerbRspec inherits poorly from its parent Autotest class, overriding several methods (but not their calling methods) and attempting to set instance variables via accessors which are declared in the superclass. This breaks Ruby's inheritance rules, and the result is that all_good is never true. Basic looping behavior seems to work anyway, but the get_to_green method never finishes.
I'm too much of a newbie to write a proper spec to prove that a loop in Autotest fails to terminate. (Not to mention I spent all afternoon chasing this bug down and it burned me out.) I detected this issue because I'm running Cucumber with David Leal's merb-cucumber plug-in, which inherits from Autotest::MerbRspec, and it wasn't displaying the right behavior when it called super in its own get_to_green.
I know this is discouraged in your contributor guidelines, but I'm attaching a patch (actually a rewritten merb_rspec.rb file) in spite of not having a spec. The simplest solution is to inherit from Autotest::Rspec instead of Autotest and not override any methods except for initialization. I'm not sure why they were overridden anyway, since they seemed to do the same thing and have no dramatic efficiency improvements. This new autotest file is a lot simpler and makes better use of the inherited behavior.