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
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
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.
>>
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
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__)
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