diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-26 09:19:45 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-26 09:19:45 +0200 |
commit | e90b58106d09af585e85238d7d49cf79f006d4d4 (patch) | |
tree | 3106b46294bb0a68c8fcd38dfc053e001a224be3 | |
parent | 119b9181ece399c67213543fb5227b82688b536f (diff) | |
parent | 330f74956763719f86acca8a0337ba320f06fd73 (diff) | |
download | rails-e90b58106d09af585e85238d7d49cf79f006d4d4.tar.gz rails-e90b58106d09af585e85238d7d49cf79f006d4d4.tar.bz2 rails-e90b58106d09af585e85238d7d49cf79f006d4d4.zip |
Merge pull request #21030 from yahonda/mysql2_20969
Remove @connection instance variable only when defined
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/quoting_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/quoting_test.rb b/activerecord/test/cases/adapters/mysql2/quoting_test.rb index a49cbba4b4..92221e61bf 100644 --- a/activerecord/test/cases/adapters/mysql2/quoting_test.rb +++ b/activerecord/test/cases/adapters/mysql2/quoting_test.rb @@ -7,14 +7,14 @@ class Mysql2QuotingTest < ActiveRecord::Mysql2TestCase test 'quoted date precision for gte 5.6.4' do @connection.stubs(:full_version).returns('5.6.4') - @connection.remove_instance_variable(:@version) + @connection.remove_instance_variable(:@version) if @connection.instance_variable_defined?(:@version) t = Time.now.change(usec: 1) assert_match(/\.000001\z/, @connection.quoted_date(t)) end test 'quoted date precision for lt 5.6.4' do @connection.stubs(:full_version).returns('5.6.3') - @connection.remove_instance_variable(:@version) + @connection.remove_instance_variable(:@version) if @connection.instance_variable_defined?(:@version) t = Time.now.change(usec: 1) refute_match(/\.000001\z/, @connection.quoted_date(t)) end |