1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove ivar only when defined

this fixes a failing test case
This commit is contained in:
Akira Matsuda 2015-07-24 06:38:56 +09:00
parent cdc32defcf
commit 430b7c8b51

View file

@ -15,14 +15,14 @@ class MysqlQuotingTest < ActiveRecord::MysqlTestCase
def test_quoted_date_precision_for_gte_564
@conn.stubs(:full_version).returns('5.6.4')
@conn.remove_instance_variable(:@version)
@conn.remove_instance_variable(:@version) if @conn.instance_variable_defined?(:@version)
t = Time.now.change(usec: 1)
assert_match(/\.000001\z/, @conn.quoted_date(t))
end
def test_quoted_date_precision_for_lt_564
@conn.stubs(:full_version).returns('5.6.3')
@conn.remove_instance_variable(:@version)
@conn.remove_instance_variable(:@version) if @conn.instance_variable_defined?(:@version)
t = Time.now.change(usec: 1)
refute_match(/\.000001\z/, @conn.quoted_date(t))
end