From 328512ea5f30dd2e408bfb002fab9ed0e1b391ce Mon Sep 17 00:00:00 2001 From: Timm Date: Sat, 20 Jul 2013 12:25:13 +0200 Subject: Removed argument and root variable in assert_select proc. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 5ce541e178..c63dd1ca8a 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -166,10 +166,8 @@ module ActionDispatch def assert_select(*args, &block) @selected ||= nil - parser = HTMLSelector.new(@selected, args, Proc.new do |_| - root = Loofah.fragment('') - root.add_child @selected - root + parser = HTMLSelector.new(@selected, args, Proc.new do + Loofah.fragment('').tap { |fragment| fragment.add_child @selected } end) # Start with optional element followed by mandatory selector. -- cgit v1.2.3