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

Commit ab52c5a

Browse files
committed
Merge pull request #2718 from rspec/remove-klass-exec-in-favour-of-rspec-support-class-exec
Use shared class_exec fallback from rspec-support
1 parent 5853848 commit ab52c5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/rspec/core/shared_example_group.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
RSpec::Support.require_rspec_support "with_keywords_when_needed"
2+
13
module RSpec
24
module Core
35
# Represents some functionality that is shared with multiple example groups.
@@ -33,7 +35,7 @@ def include_in(klass, inclusion_line, args, customization_block)
3335
klass.update_inherited_metadata(@metadata) unless @metadata.empty?
3436

3537
SharedExampleGroupInclusionStackFrame.with_frame(@description, inclusion_line) do
36-
klass.class_exec(*args, &@definition)
38+
RSpec::Support::WithKeywordsWhenNeeded.class_exec(klass, *args, &@definition)
3739
klass.class_exec(&customization_block) if customization_block
3840
end
3941
end

0 commit comments

Comments
 (0)