Sha256: 08543f889eb246f93d10f7f62004728649c0d35f6cd7ad0240353aa9b52a340a

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require 'test_helper'
require 'arjdbc/oracle'

class OracleUnitTest < Test::Unit::TestCase

  test 'oracle identifier lengths' do
    connection = new_adapter_stub
    assert_equal 30, connection.table_alias_length
    assert_equal 30, connection.table_name_length
    assert_equal 30, connection.index_name_length
    assert_equal 30, connection.column_name_length
  end

  test 'default sequence name respects identifier length' do
    connection = new_adapter_stub
    assert_equal 'ferko_seq', connection.default_sequence_name('ferko')
    assert_equal 'abcdefghi_abcdefghi_abcdef_seq', connection.default_sequence_name('abcdefghi_abcdefghi_abcdefghi_')
  end
  
  private
  
  def new_adapter_stub(config = {})
    config = config.merge({ :adapter => 'oracle', :adapter_spec => ArJdbc::Oracle })
    connection = stub('connection'); logger = nil
    connection.stub_everything
    adapter = ActiveRecord::ConnectionAdapters::JdbcAdapter.new connection, logger, config
    yield(adapter) if block_given?
    adapter
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-jdbc-adapter-1.3.0.beta2 test/db/oracle/unit_test.rb
activerecord-jdbc-adapter-1.3.0.beta1 test/db/oracle/unit_test.rb