I have the RSpec sample in ./rspec_bowling, with…
./rspec_bowling/lib/bowling.rb
./rspec_bowling/spec/spec.opts
./rspec_bowling/spec/bowling_spec.rb
when I autotest, I get this:
$autotest
loading autotest/rspec
/usr/local/bin/ruby -S
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.3/bin/spec -O spec/spec.opts
spec/spec_helper.rb spec/bowling_spec.rb
F
ArgumentError in ‘Bowling should score 0 for gutter game’
wrong number of arguments (1 for 0)
[…snip…]
Finished in 0.254 seconds
1 example, 1 failure
/usr/local/bin/ruby -S
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.3/bin/spec -O spec/spec.opts
spec/bowling_spec.rb
*./spec/bowling_spec.rb:3:in `require’: no such file to load – bowling
(LoadError)
from ./spec/bowling_spec.rb:3
My RUBYPATH = …/lib:./lib:$PATH, which caused autotest to load the 1st
run
correctly.
Could someone help me understand how to correctly set the search path
for
repeated loading under autotest ?
On Sat, Apr 5, 2008 at 6:08 AM, Peter F. < [email protected]> wrote:
Hello all,
/usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.3/bin/spec -O spec/spec.opts
arguments that is being called with one.
Hello All,
Thanks for your tips.
In the end, what I needed was a lesson on Ruby Load Path. Pickaxe 2
pp172
“Where Ruby finds its modules” gave me the answer. I needed to set
environment variable RUBYLIB
export RUBYLIB=./lib:…/lib
so that
$ruby -e ‘puts $:’
./lib
…/lib
/usr/local/lib/ruby/site_ruby/1.8
/usr/local/lib/ruby/site_ruby/1.8/i386-cygwin
/usr/local/lib/ruby/site_ruby
/usr/local/lib/ruby/1.8
/usr/local/lib/ruby/1.8/i386-cygwin
.
Now autotest gets the proper require twice in a row, when the spec file
reads :
require ‘bowling’
Hope this helps you, next grasshopper of the RSpec FU!