Skip to content

Commit

Permalink
Merge pull request #2718 from rspec/remove-klass-exec-in-favour-of-rs…
Browse files Browse the repository at this point in the history
…pec-support-class-exec

Use shared class_exec fallback from rspec-support
  • Loading branch information
JonRowe committed May 2, 2020
1 parent 5853848 commit ab52c5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rspec/core/shared_example_group.rb
@@ -1,3 +1,5 @@
RSpec::Support.require_rspec_support "with_keywords_when_needed"

module RSpec
module Core
# Represents some functionality that is shared with multiple example groups.
Expand Down Expand Up @@ -33,7 +35,7 @@ def include_in(klass, inclusion_line, args, customization_block)
klass.update_inherited_metadata(@metadata) unless @metadata.empty?

SharedExampleGroupInclusionStackFrame.with_frame(@description, inclusion_line) do
klass.class_exec(*args, &@definition)
RSpec::Support::WithKeywordsWhenNeeded.class_exec(klass, *args, &@definition)
klass.class_exec(&customization_block) if customization_block
end
end
Expand Down

0 comments on commit ab52c5a

Please sign in to comment.