# Setting up lib/test/rakefile references for a testing task

**URL:** <https://www.ruby-forum.com/t/setting-up-lib-test-rakefile-references-for-a-testing-task/179566>\
**Category:** Ruby\
**Created:** [November 28, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/setting-up-lib-test-rakefile-references-for-a-testing-task/179566 "2009-11-28T19:33:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 28, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/setting-up-lib-test-rakefile-references-for-a-testing-task/179566/1 "2009-11-28T19:33:05Z")

</div>

Hey All,

I’m trying to set up a set of project folders & a test task for rake &  
am having trouble figuring out how to let all my code find the other  
bits of code. My project files & folders are set up like so:

/dbi-ado  
rakefile.rb  
/lib  
/dbd  
ado.rb \<-- requires lib/dbd/ado/database.rb and lib/dbd/ado/  
driver.rb  
/ado  
database.rb  
driver.rb  
/test  
test\_dbd\_ado.rb \<-- requires lib/dbd/ado

My test task is:

task :test do  
# puts(“Pretend I am running your tests!”)  
# Is this the best way to invoke tests? Very much a noob here…  
# require ‘test/test\_dbd\_ado’  
%x(ruby -I . test/test\_dbd\_ado.rb)  
end

I’m running ruby 1.9.1 on windows. When I do a ‘rake test’ in my /dbi-  
ado folder I get:

C:\Documents and Settings\pardre1\My Documents\ruby\my\_gems\dbi-  
ado\>rake test  
(in C:/Documents and Settings/pardre1/My Documents/ruby/my\_gems/dbi-  
ado)  
C:/Documents and Settings/pardre1/My Documents/ruby/my\_gems/dbi-ado/  
lib/dbd/ado.  
rb:4:in `require': no such file to load -- dbd/ado/database (LoadError) from C:/Documents and Settings/pardre1/My Documents/ruby/ my_gems/dbi-ado /lib/dbd/ado.rb:4:in`\<top (required)\>’  
from test/test\_dbd\_ado.rb:2:in `require' from test/test_dbd_ado.rb:2:in`’

I don’t understand the problem–I thought that passing ‘.’ (current  
dir) to ruby’s I param would put that dir on the search path for  
references & therefor a “require ‘dbd/ado/database’” should resolve  
properly to dbi-ado/lib/dbd/ado/database.rb. But it seems not.

Can somebody throw me a clue here?

Many thanks!

-Roy
