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

2011-01-21 Thread Andrew Premdas
On 21 January 2011 21:15, Matt Wynne wrote: > > On 21 Jan 2011, at 16:22, Brian Warner wrote: > > > Matt Wynne wrote in post #976412: > >> On 20 Jan 2011, at 19:32, Brian Warner wrote: > >> > >>> I have a file in step_definitions that's giving me an error for an > >>> uninitialized constant. My g

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

2011-01-21 Thread Matt Wynne
On 21 Jan 2011, at 16:22, Brian Warner wrote: > Matt Wynne wrote in post #976412: >> On 20 Jan 2011, at 19:32, Brian Warner wrote: >> >>> 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 i

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

2011-01-21 Thread Brian Warner
Matt Wynne wrote in post #976412: > On 20 Jan 2011, at 19:32, Brian Warner wrote: > >> 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. >>

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

2011-01-20 Thread Matt Wynne
On 20 Jan 2011, at 19:32, Brian Warner wrote: > 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/codebr

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

2011-01-20 Thread Wilker
Usually you can do some relative path requires, you can do it on your spec/spec_helper.rb require File.expand_path("../../lib/codebreaker", __FILE__) or, another common setup is to add the "lib" into require path list, and them just require the file: $: << File.expand_path("../../lib", __FILE__)

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

2011-01-20 Thread Brian Warner
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 e