Based on your setup, that shouldn't really be an issue. The post you linked to stated, that the root cause was that they had a module and a class with the same name:
It was because I also had a class Admin, as well as a namespace Admin. Since Admin was a class (a model) it inherited from Object which made the top-level ApplicationController available inside the Admin namespace. The reply by Andrew White on http://groups.google.com/group/rubyonrails-core/browse_thread/thread/bab5e87ee10d2ecb lead me to find the right answer. In the end I renamed Admin to AdminUser and everything fell into place.
I think this sort of base conflict is asking for heisenbugs, due to the order that rails just happens to autoload first.
Are you sure that isn't what you have as well?
--
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 rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/f5e90f8b-a63c-44cd-a78a-f0f22524ed6c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I think this sort of base conflict is asking for heisenbugs, due to the order that rails just happens to autoload first.
require 'spec_helper'require_dependency './app/models/price_request/integer_variable' # NEW 'FIX' LINEdescribe PriceRequest::IntegerVariable do
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.rb
module PriceRequest
# code
end
# price_request/integer_variable.rb
require_relative '../price_request'
module PriceRequest
class IntegerVariable
# code
end
end
# spec/price_request/integer_variable_spec.rb
require 'spec_helper'
require 'price_request/integer_variable'
describe PriceRequest::IntegerVariable do
# specs
end
--
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 rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/15b29c06-709c-4627-bccf-f45f64ad62fc%40googlegroups.com.