Thursday, June 12, 2008

ZenTest and autotest in Windows with RSpec and Rails

I've been trying to monkey-patch ZenTest's autotest for over a month now.  Originally, I was trying to get it to work (well) with snarl, but that just seems frivolous at this point.  My focus now is just to get the damn tests working as they should.

First of all, Windows doesn't let you break out of the loop.  ...At least, not that I've ever seen.  I haven't heard a SINGLE person on the web talk about this, which is frustrating.  Maybe I'm missing something stupid, but I know other people that this is happening to.

Anyway, the fix for that is to change the "Kernel.sleep 1.5" on line 291 of autotest.rb... it works if you change it to this:

    30.times { Kernel.sleep 0.05 }

I don't know why, but I'm assuming it has something to do with how sleep is implemented on Windows that causes it to lose the scope of self.interrupted.  Or something.  Whatever: this works.

Next, I'll try to find a regex that will actaully find the right files to run, when there has been a change!  Grr.

No comments: