Sha256: 922689c023fcf5f3ff645617e127fbaea87c15ed70a50765c0ce2207a61eb5ac

Contents?: true

Size: 716 Bytes

Versions: 5

Compression:

Stored size: 716 Bytes

Contents

require 'helper'

class TestMultilineSql < Test::Unit::TestCase
  def test_multiline_sql
    a = Mysql2xxxx::JSON.new @options.merge(:execute => %{
      DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t1 SELECT CONCAT_WS('-', year, make_name) AS crazy_name FROM automobile_make_years; SELECT * FROM t1
      })
    str = a.to_s
    assert str.include?('2002-Acura')
  end
  def test_multiline_sql_with_ending_semicolon
    a = Mysql2xxxx::JSON.new @options.merge(:execute => %{
      DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t1 SELECT CONCAT_WS('-', year, make_name) AS crazy_name FROM automobile_make_years; SELECT * FROM t1
      ;
      })
    str = a.to_s
    assert str.include?('2002-Acura')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mysql2xxxx-0.2.1 test/test_multiline_sql.rb
mysql2xxxx-0.2.0 test/test_multiline_sql.rb
mysql2xxxx-0.1.1 test/test_multiline_sql.rb
mysql2xxxx-0.1.0 test/test_multiline_sql.rb
mysql2xxxx-0.0.4 test/test_multiline_sql.rb