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

Commit 1de4389

Browse files
committed
Skip unnecessary :context|:all hooks
This makes that previous test pass, and the test suite is still green, so I'm _assuming_ that this works and doesn't break other stuff! However, I'd be happy to make any alterations if this doesn't look like it's the right way of tackling this problem.
1 parent 8bf66f5 commit 1de4389

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rspec/core/hooks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def register(prepend_or_append, position, *args, &block)
455455
def run(position, scope, example_or_group)
456456
return if RSpec.configuration.dry_run?
457457

458-
if scope == :context
458+
if scope == :context && !example_or_group.class.metadata[:skip]
459459
run_owned_hooks_for(position, :context, example_or_group)
460460
else
461461
case position

0 commit comments

Comments
 (0)