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

Commit 690a294

Browse files
committed
Small refactor to add intention revealing message
1 parent 9fc9024 commit 690a294

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/rspec/core/example_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def self.subclass(parent, args, &example_group_block)
242242
# to ensure that it takes precendence when there are name collisions.
243243
# Thus, we delay including it until after the example group block
244244
# has been eval'd.
245-
subclass.send(:include, MemoizedHelpers.module_for(subclass))
245+
MemoizedHelpers.define_helpers_on(subclass)
246246

247247
subclass
248248
end

lib/rspec/core/memoized_helpers.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ def self.module_for(example_group)
474474
end
475475
end
476476

477+
# @api private
478+
def self.define_helpers_on(example_group)
479+
example_group.send(:include, module_for(example_group))
480+
end
481+
477482
if Module.method(:const_defined?).arity == 1 # for 1.8
478483
# @api private
479484
#

0 commit comments

Comments
 (0)