From d708984f68a90fee8835729515c2367d4a09da83 Mon Sep 17 00:00:00 2001 From: Aleksei Lipniagov Date: Thu, 11 Jul 2019 12:19:05 +0300 Subject: Move the comment above the method definition --- spec/support/helpers/test_env.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index 634d62101bd..893b10ea752 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -308,13 +308,11 @@ module TestEnv Thread.current[:current_example_group] end + # looking for a top-level `describe` def topmost_example_group - topmost_group = current_example_group - - # looking for a top-level `describe` - topmost_group = topmost_group[:parent_example_group] until topmost_group[:parent_example_group].nil? - - topmost_group + example_group = current_example_group + example_group = example_group[:parent_example_group] until example_group[:parent_example_group].nil? + example_group end private -- cgit v1.2.1