I brought this up some time ago.<br><br>I'm trying to use autotest to run specs in a non-rails project.<br><br>FWIW the project is structured using the bones gem.<br><br>$ spec -v<br>rspec 1.1.11<br>k$ gem list zentest<br>
<br>*** LOCAL GEMS ***<br><br>ZenTest (3.11.0, 3.9.1, 3.9.0, 3.8.0, 3.7.1, 3.7.0, 3.6.1)<br><br>$ cat .autotest <br>Autotest.add_hook :initialize do |at|<br> %w{.svn .hg .git .bzr}.each { |exception| at.add_exception(exception) }<br>
at.clear_mappings<br> <br><br> at.add_mapping(%r%^(spec/(spec_helper|shared/.*)|config/(boot|environment(s/test)?))\.rb$%) {<br> at.files_matching %r%^spec/(models|controllers|views|helpers)/.*_spec\.rb$%<br> }<br>
at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|<br> ["spec/lib/#{m[1]}_spec.rb"]<br> }<br><br>end<br><br>Autotest.add_discovery do<br> "rspec" if File.directory?('spec') && ENV['RSPEC']<br>
end<br><br><br>$ autospec<br>loading autotest/rspec<br>/opt/local/bin/ruby -S spec/lib/v_date_time_property_spec.rb spec/lib/v_date_property_spec.rb spec/lib/v_property_spec.rb spec/lib/parser_spec.rb spec/lib/t_z_info_vtimezone_spec.rb <br>
spec/lib/v_date_time_property_spec.rb:8: warning: parenthesize argument(s) for future version<br>spec/lib/v_date_time_property_spec.rb:12: warning: parenthesize argument(s) for future version<br>spec/lib/v_date_time_property_spec.rb:4: undefined method `describe' for main:Object (NoMethodError)<br>
<br><br>For some reason, it's running the specs as plain old ruby files and the RSpec framework doesn't seem to be being intialized.<br><br>I've done lots of googling about this, and everything about running autotest for RSpec for non-rails projects seems to be quite old. I did find one old post which recommended making a .autotest file in the project with mappings based on the rspec-rails mappings, which is what I tried above, but no joy.<br>
<br>Any insight?<br clear="all"><br>-- <br>Rick DeNatale<br><br>My blog on Ruby<br><a href="http://talklikeaduck.denhaven2.com/">http://talklikeaduck.denhaven2.com/</a><br>