Skip to content

Commit eba6719

Browse files
committed
Documentation for spec demonstrating method_missing issue
1 parent 0f52603 commit eba6719

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/rspec/rails/example/controller_example_group_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ def group_for(klass)
2525
def a_method(value:); value; end
2626
def method_missing(_name, *_args, **kwargs, &_block); a_method(**kwargs); end
2727

28+
# This example requires prepend so that the `method_missing` definition
29+
# from `ControllerExampleGroup` bubbles up to our artificial one, in reality
30+
# this is likely to be either an internal RSpec dispatch or one from a 3rd
31+
# party gem.
2832
prepend ControllerExampleGroup
2933
end
3034
example = group.new

0 commit comments

Comments
 (0)