提交 150f4099 编写于 作者: P Prem Sichanugrist

Silence warning from MySQL::Error object in test

When running Active Record MySQL test, this warning is printed in the
console:

    warning: instance variable errno not initialized

It turns out that this is a warning from `mysql` gem in MySQL::Error
object. However, since the `mysql` gem is no longer maintained, and
there won't be a newer version, it make sense for us to just silence
this warning to make the output cleaner.
上级 03e987cd
......@@ -21,7 +21,9 @@ def setup
@connection.execute "SELECT count(*) from products"
@connection.disconnect!
assert_raises(ActiveRecord::StatementInvalid) do
@connection.execute "SELECT count(*) from products"
silence_warnings do
@connection.execute "SELECT count(*) from products"
end
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册