Skip to content

Commit

Permalink
Documentation for spec demonstrating method_missing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Aug 13, 2021
1 parent 0f52603 commit 88a8dc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/rspec/rails/example/controller_example_group_spec.rb
Expand Up @@ -25,6 +25,10 @@ def group_for(klass)
def a_method(value:); value; end
def method_missing(_name, *_args, **kwargs, &_block); a_method(**kwargs); end

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

0 comments on commit 88a8dc0

Please sign in to comment.