[rspec-users] 'require'ing files from other directories

Brian Warner lists at ruby-forum.com
Thu Jan 20 14:32:33 EST 2011


I'm going through The RSpec Book and am currently working with the
Mastermind game example.

But that's besides the point.

The way my directories are setup is like so:

/mastermind/features/step_definitions...
/mastermind/lib/codebreaker/...

I have a file in step_definitions that's giving me an error for an
uninitialized constant. My guess is I need to 'require' the file where
that class is defined. Said files is located in /lib/codebreaker.

I am very new to Ruby so this is probably a really simple question but
how do I 'require' a file in codebreaker from a file inside
step_definitions?

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list