Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 3ada308

Browse files
committed
Wait to configure expose_dsl_globally until RSpec is fully defined.
Some config methods use `RSpec.world` and have problems if `RSpec.world` has not been defined yet. So it's best to wait to configure anything until `RSpec` is defined.
1 parent 83cba5d commit 3ada308

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rspec/core.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def self.clear_examples
8383
def self.configuration
8484
@configuration ||= RSpec::Core::Configuration.new
8585
end
86-
configuration.expose_dsl_globally = true
8786

8887
# Yields the global configuration to a block.
8988
# @yield [Configuration] global configuration
@@ -178,4 +177,7 @@ def self.const_missing(name)
178177
require MODULES_TO_AUTOLOAD.fetch(name) { return super }
179178
::RSpec.const_get(name)
180179
end
180+
181+
Core::DSL.expose_globally!
182+
Core::SharedExampleGroup::TopLevelDSL.expose_globally!
181183
end

0 commit comments

Comments
 (0)