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:
parent
cdc32defcf
commit
430b7c8b51
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue