Tuesday, October 30, 2007

Running RSpec with Autotest on Windows

If you are on Windows and you see a LoadError similar to this when running autotest:

custom_require.rb:27:in `gem_original_require': no such file to load -- c:\ruby\bin\spec (LoadError) from...
Open ruby\gems\1.8\gems\rspec-1.0.8\lib\autotest\rspec.rb and change this line

return "#{ruby} -S #{@spec_command} #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}"

with this one

return "#{ruby} -S spec #{add_options_if_present} #{files_to_test.keys.flatten.join(' ')}"

This fixed my problem but of course it's just a hack.

0 comments: