Sha256: 506a2ab3df55ca52ab8649328f6a50cf8f35e7059a73301b31a321e8e303c823

Contents?: true

Size: 886 Bytes

Versions: 1

Compression:

Stored size: 886 Bytes

Contents

# coding: utf-8
require 'helper'

class TestMysql2xxxx < Test::Unit::TestCase
  def test_1_mysql2json
    a = Mysql2xxxx::JSON.new @options
    str = a.to_s
    assert str.include?('Acura')
    assert str.include?('Citroën')
    assert !str.include?('DaimlerChrysler')
  end

  def test_2_mysql2csv
    a = Mysql2xxxx::CSV.new @options
    str = a.to_s
    assert str.include?('Acura')
    assert str.include?('Citroën')
    assert !str.include?('DaimlerChrysler')
  end
  
  def test_3_mysql2xml
    a = Mysql2xxxx::XML.new @options
    str = a.to_s
    assert str.include?('Acura')
    assert str.include?('Citro&#235;n')
    assert !str.include?('DaimlerChrysler')
  end
  
  def test_4_slash_n_for_nulls
    a = Mysql2xxxx::CSV.new @options
    assert a.to_s.include?(',,')
    b = Mysql2xxxx::CSV.new @options.merge(:slash_n => true)
    assert b.to_s.include?(',\N,')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mysql2xxxx-0.2.0 test/test_mysql2xxxx.rb