Sha256: cb1aa13f01936891eb59c1329533246aa674bfa1bd5389a9c83e08a4977e8b6f

Contents?: true

Size: 778 Bytes

Versions: 96

Compression:

Stored size: 778 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

96 entries across 93 versions & 18 rubygems

Version Path
activerecord-2.3.6 test/cases/active_schema_test_postgresql.rb
radiant-0.8.2 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
radiant-0.9.0.rc2 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
webroar-0.3.1 src/admin_panel/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
webroar-0.3.0 src/admin_panel/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activerecord/pkg/activerecord-2.3.3/test/cases/active_schema_test_postgresql.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activerecord/pkg/activerecord-2.2.2/test/cases/active_schema_test_postgresql.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
simply_stated-0.0.5 vendor/gems/ruby/1.8/gems/activerecord-2.3.5/test/cases/active_schema_test_postgresql.rb
simply_stated-0.0.4 vendor/gems/ruby/1.8/gems/activerecord-2.3.5/test/cases/active_schema_test_postgresql.rb
factorylabs-castronaut-0.7.5 vendor/activerecord/test/cases/active_schema_test_postgresql.rb
ginst-2009.12.8 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
activerecord-2.3.5 test/cases/active_schema_test_postgresql.rb
ginst-2009.11.24 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
ginst-2009.11.23 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
ginst-2.0.1 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
ginst-2.0.0 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
gemstreamer-1.2.0 spec/assets/testapp/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
gemstreamer-1.1.1 spec/assets/testapp/vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb