diff --git a/lib/capybara/rspec/matcher_proxies.rb b/lib/capybara/rspec/matcher_proxies.rb index 0b5de6d77..16109ff2c 100644 --- a/lib/capybara/rspec/matcher_proxies.rb +++ b/lib/capybara/rspec/matcher_proxies.rb @@ -10,9 +10,9 @@ def all(*args, **kwargs, &) end end - def within(*args, **kwargs, &) + def within(*args, **kwargs, &block) if block - within_element(*args, **kwargs, &) + within_element(*args, **kwargs, &block) else be_within(*args) end