Sha256: 3756869a0e11651eeb6a5e58af1fd8147aed9cf41f15542086dfc1d99a10d671

Contents?: true

Size: 772 Bytes

Versions: 5

Compression:

Stored size: 772 Bytes

Contents

require 'cases/helper'

class PostgresqlActiveSchemaTest < Test::Unit::TestCase
  def setup
    ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
      alias_method :real_execute, :execute
      def execute(sql, name = nil) sql end
    end
  end

  def teardown
    ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:alias_method, :execute, :real_execute)
  end

  def test_create_database_with_encoding
    assert_equal "CREATE DATABASE matt ENCODING = 'utf8'", create_database(:matt)
    assert_equal "CREATE DATABASE aimonetti ENCODING = 'latin1'", create_database(:aimonetti, :encoding => :latin1)
  end

  private
    def method_missing(method_symbol, *arguments)
      ActiveRecord::Base.connection.send(method_symbol, *arguments)
    end
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
vibes-bj-1.2.2 spec/rails_root/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
vibes-bj-1.2.1 spec/rails_root/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
activerecord-2.1.0 test/cases/active_schema_test_postgresql.rb
antfarm-0.3.0 rails/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
antfarm-0.4.0 rails/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb