within_* methods don't yield if no block given

This commit is contained in:
Thomas Walpole 2018-05-29 13:26:24 -07:00
parent feda4f8b24
commit b1d98f7c9b
1 changed files with 3 additions and 3 deletions

View File

@ -331,7 +331,7 @@ module Capybara
new_scope = args.first.respond_to?(:to_capybara_node) ? args.first.to_capybara_node : find(*args)
begin
scopes.push(new_scope)
yield
yield if block_given?
ensure
scopes.pop
end
@ -413,7 +413,7 @@ module Capybara
def within_frame(*args)
switch_to_frame(_find_frame(*args))
begin
yield
yield if block_given?
ensure
switch_to_frame(:parent)
end
@ -514,7 +514,7 @@ module Capybara
end
begin
yield
yield if block_given?
ensure
_switch_to_window(original) unless original == window_or_proc
end