File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,15 @@ def self.run_all(reporter = nil)
52
52
config . warnings = true
53
53
config . raise_on_warning = true
54
54
55
+ # Execute a provided block with RSpec global objects (configuration,
56
+ # world, current example) reset. This is used to test specs with RSpec.
55
57
config . around ( :example ) do |example |
56
- RSpec ::Core ::Sandbox . sandboxed do |config |
57
- RSpec ::Rails . initialize_configuration ( config )
58
+ # If there is an example-within-an-example, we want to make sure the inner
59
+ # example does not get a reference to the outer example (the real spec) if
60
+ # it calls something like `pending`.
61
+ RSpec ::Core ::Sandbox . sandboxed do |sandbox_config |
62
+ sandbox_config . before ( :context ) { RSpec . current_example = nil }
63
+ RSpec ::Rails . initialize_configuration ( sandbox_config )
58
64
example . run
59
65
end
60
66
end
You can’t perform that action at this time.
0 commit comments