提交 059d609a 编写于 作者: E Emilio Tagua

Avoid more uninitialized variable warnings.

上级 97174980
......@@ -66,7 +66,7 @@ def view_context_class
attr_writer :view_context_class
def view_context_class
@view_context_class || self.class.view_context_class
(@view_context_class ||= nil) || self.class.view_context_class
end
def initialize(*)
......
......@@ -187,6 +187,7 @@ def css_select(*args)
def assert_select(*args, &block)
# Start with optional element followed by mandatory selector.
arg = args.shift
@selected ||= nil
if arg.is_a?(HTML::Node)
# First argument is a node (tag or text, but also HTML root),
......@@ -197,7 +198,7 @@ def assert_select(*args, &block)
# This usually happens when passing a node/element that
# happens to be 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 defined?(@selected) && @selected
elsif @selected
root = HTML::Node.new(nil)
root.children.concat @selected
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册