On Wed, Oct 8, 2008 at 5:58 PM, Pat Maddox <[EMAIL PROTECTED]> wrote:
> Wes Gamble <[EMAIL PROTECTED]> writes:
>
>> Scott Taylor wrote:
>>>
>>> On Oct 8, 2008, at 6:26 PM, Wes Gamble wrote:
>>>
>>>> I'm trying to debug what I suspect is a case where spec_helper.rb is not
>>>> being executed.
>>>>
>>>> I put a puts statement inside the Spec::Runner.configure do |config|
>>>> block, and I can't ever see the printout.
>>>>
>>>> When does spec_helper.rb get run during rspec operation?
RSpec does not "run" spec_helper. By default, rspec loads files that
end with "_spec.rb" and it is up to those files to require
spec_helper.rb.
HTH,
David
>>>>
>>>
>>> What does your spec_helper.rb contain?
>>>
>>> AFAIK, it gets executed before anything else - usually it contains
>>> Spec::Runner.configure { .. }
>> It is the standard default spec_helper.rb (see below). I could find
>> no reference to it in the rake "spec" task. I added this:
>>
>> require '../../spec/spec_helper'
>>
>> to the "spec" task and now it gets all of the config from spec_helper
>> (including RAILS_ENV which was not being set before).
>
> You don't want to put this in the spec task itself...you should require
> it from your spec files. It wasn't ever being run because it wasn't
> ever being loaded :)
>
> Pat
> _______________________________________________
> rspec-users mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rspec-users
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users