Hmm, yeah I can see that causing problems.  They may not be easily solvable.

One alternate approach: use `defined?(RSpec::Mocks.configuration)` and `defined?(RSpec::Expectations.configuration)` and then you can can use `stub_const("RSpec::Mocks", Module.new, :transfer_nested_constants => true)` and then the `defined?` checks will return false but code that needs to access a nested constant will still work.