From 31330ef9a0c1bb18d8d94e28891087e25d941489 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 18 Aug 2014 17:16:08 -0300 Subject: [PATCH] web_steps: make with_scope more clear --- features/step_definitions/web_steps.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index fd1994a..3274cef 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -11,8 +11,14 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "pat module WithinHelpers def with_scope(locator) - locator = locator ? first(locator) : locator - locator ? within(locator) { yield } : yield + if locator + locator = first(locator) || locator + within(locator) do + yield + end + else + yield + end end end World(WithinHelpers) -- libgit2 0.21.2