Sha256: c1ae6932947a7dd6e69a98c4f817cb6f6b934b7236505cd7bacdfacf26faf762

Contents?: true

Size: 744 Bytes

Versions: 14

Compression:

Stored size: 744 Bytes

Contents

require 'java'
require 'lib/jdbc_adapter/jdbc_db2'
require 'test/unit'

class JdbcSpec::DB2Test < Test::Unit::TestCase
  def setup
    @inst = Object.new
    @inst.extend JdbcSpec::DB2
    @column = Object.new
    class <<@column
      attr_accessor :type
    end
  end
  
  def test_quote_decimal
    assert_equal %q{'123.45'}, @inst.quote("123.45")
    @column.type = :decimal
    assert_equal %q{123.45}, @inst.quote("123.45", @column), "decimal columns should not have quotes"
  end
  
  def test_primary_key_generation
    @column.type = :primary_key
    assert_equal 'int not null generated by default as identity (start with 1) primary key', @inst.modify_types({:string => {}, :integer => {}, :boolean => {}})[:primary_key]
  end
  
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
saturnflyer-activerecord-jdbc-adapter-0.9.3 test/jdbc_adapter/jdbc_db2_test.rb
kb-activerecord-jdbc-adapter-0.9.7.1-java test/jdbc_adapter/jdbc_db2_test.rb
activerecord-jdbc-adapter-0.9.7-java test/jdbc_adapter/jdbc_db2_test.rb
activerecord-jdbc-adapter-0.9.6-java test/jdbc_adapter/jdbc_db2_test.rb
activerecord-jdbc-adapter-0.9.5-java test/jdbc_adapter/jdbc_db2_test.rb
activerecord-jdbc-adapter-0.9.4-java test/jdbc_adapter/jdbc_db2_test.rb
activerecord-jdbc-adapter-0.9.3-java test/jdbc_adapter/jdbc_db2_test.rb
jpzwarte-activerecord-jdbc-adapter-0.9.2.6 test/jdbc_adapter/jdbc_db2_test.rb
jpzwarte-activerecord-jdbc-adapter-0.9.2.5 test/jdbc_adapter/jdbc_db2_test.rb
jpzwarte-activerecord-jdbc-adapter-0.9.2.4 test/jdbc_adapter/jdbc_db2_test.rb
jpzwarte-activerecord-jdbc-adapter-0.9.2.3 test/jdbc_adapter/jdbc_db2_test.rb
jpzwarte-activerecord-jdbc-adapter-0.9.2.2 test/jdbc_adapter/jdbc_db2_test.rb
jpzwarte-activerecord-jdbc-adapter-0.9.2.1 test/jdbc_adapter/jdbc_db2_test.rb
activerecord-jdbc-adapter-0.9.2 test/jdbc_adapter/jdbc_db2_test.rb