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

Commit f8d8ef4

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 f8d8ef4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rspec/core/hooks.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ def run(position, scope, example_or_group)
456456
return if RSpec.configuration.dry_run?
457457

458458
if scope == :context
459-
run_owned_hooks_for(position, :context, example_or_group)
459+
unless example_or_group.class.metadata[:skip]
460+
run_owned_hooks_for(position, :context, example_or_group)
461+
end
460462
else
461463
case position
462464
when :before then run_example_hooks_for(example_or_group, :before, :reverse_each)

0 commit comments

Comments
 (0)