What I mean is, it seems you are very much relying fixing the spec by
messing with the load order in a non-standard way. This means if/when the
load order changes (say in the rails app since rails lazy loads), you will
have issues. Why are you not just using the standard require or
require_relative to make sure these types of dependencies are pre-loaded?

# price_request.rbmodule PriceRequest
  # codeend
# price_request/integer_variable.rb
require_relative '../price_request'
module PriceRequest
  class IntegerVariable
    # code
  endend
# spec/price_request/integer_variable_spec.rbrequire
'spec_helper'require 'price_request/integer_variable'

describe PriceRequest::IntegerVariable do

  # specsend



On Mon, Jul 8, 2013 at 3:45 PM, Gallagher Polyn
<[email protected]>wrote:

> I think this sort of base conflict is asking for heisenbugs, due to the
>> order that rails just happens to autoload first.
>>
> By 'heisenbugs' you mean something I could avoid in test by changing the
> model file structure?
>
> With a little more snooping, I found a fix suggested 
> here<https://github.com/rails/rails/issues/6931>,
> which I applied to rectify my failing spec test file as follows:
>
> require 'spec_helper'
> require_dependency './app/models/price_request/integer_variable' # NEW
> 'FIX' LINE
>
> describe PriceRequest::IntegerVariable do
>
>           ...
>
> I'd prefer the fix in the spec_helper, but the above works.
>
> Thanks,
>
> G-man
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rspec/15b29c06-709c-4627-bccf-f45f64ad62fc%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CAKCESdjM5QRFAe69R2os%3D_Zd%3D91TWWvtS3M0gavLGEj7rZNAWg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to