Skip to content

Commit

Permalink
Small refactor to add intention revealing message
Browse files Browse the repository at this point in the history
  • Loading branch information
alindeman committed Jun 11, 2013
1 parent 9fc9024 commit 690a294
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/core/example_group.rb
Expand Up @@ -242,7 +242,7 @@ def self.subclass(parent, args, &example_group_block)
# to ensure that it takes precendence when there are name collisions.
# Thus, we delay including it until after the example group block
# has been eval'd.
subclass.send(:include, MemoizedHelpers.module_for(subclass))
MemoizedHelpers.define_helpers_on(subclass)

subclass
end
Expand Down
5 changes: 5 additions & 0 deletions lib/rspec/core/memoized_helpers.rb
Expand Up @@ -474,6 +474,11 @@ def self.module_for(example_group)
end
end

# @api private
def self.define_helpers_on(example_group)
example_group.send(:include, module_for(example_group))
end

if Module.method(:const_defined?).arity == 1 # for 1.8
# @api private
#
Expand Down

0 comments on commit 690a294

Please sign in to comment.