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

Commit 3dab6d1

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 3dab6d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/rspec/core/hooks.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ def all_hooks_for(position, scope)
503503
end
504504

505505
def run_owned_hooks_for(position, scope, example_or_group)
506+
return if example_or_group.class.respond_to?(:metadata) &&
507+
example_or_group.class.metadata.keys.include?(:skip)
506508
matching_hooks_for(position, scope, example_or_group).each do |hook|
507509
hook.run(example_or_group)
508510
end

0 commit comments

Comments
 (0)