Skip to content

Commit

Permalink
Merge pull request #97 from yogeshjain999/fix-ruby-2.6-calls
Browse files Browse the repository at this point in the history
Fix method signature for ruby <= 2.6
  • Loading branch information
seuros authored Sep 16, 2021
2 parents c25aede + 35ab7e0 commit 456a9e1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/rspec/cells/example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ module ExampleGroup

attr_reader :routes

def method_missing(method, *args, **kwargs, &block)
# Send the route helpers to the application router.
if route_defined?(method)
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
def method_missing(method, *args, **kwargs, &block)
# Send the route helpers to the application router.
return super unless route_defined?(method)

controller.send(method, *args, **kwargs, &block)
else
super
end
else
def method_missing(method, *args, &block)
# Send the route helpers to the application router.
return super unless route_defined?(method)

controller.send(method, *args, &block)
end
end

Expand Down

0 comments on commit 456a9e1

Please sign in to comment.