提交 4b55c0aa 编写于 作者: T Timm

Moved: initial assignment of @selector_is_second_argument is now in initialize.

上级 cabef141
......@@ -311,6 +311,7 @@ class HTMLSelector #:nodoc:
def initialize(selected, page, args)
# Start with possible optional element followed by mandatory selector.
@selector_is_second_argument = false
@root = determine_root_from(args.first, page, selected)
@selector = extract_selector(args)
......@@ -354,7 +355,6 @@ def filter(matches)
end
def determine_root_from(root_or_selector, page, previous_selection = nil)
@selector_is_second_argument = false
if root_or_selector == nil
raise ArgumentError, "First argument is either selector or element to select, but nil found. Perhaps you called assert_select with an element that does not exist?"
elsif root_or_selector.respond_to?(:css)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册