~michaelforrest/use-case-mapper/trunk

« back to all changes in this revision

Viewing changes to vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb

  • Committer: Richard Lee (Canonical)
  • Date: 2010-10-15 15:17:58 UTC
  • mfrom: (190.1.3 use-case-mapper)
  • Revision ID: richard.lee@canonical.com-20101015151758-wcvmfxrexsongf9d
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
require 'cases/helper'
2
 
 
3
 
class PostgresqlActiveSchemaTest < Test::Unit::TestCase
4
 
  def setup
5
 
    ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
6
 
      alias_method :real_execute, :execute
7
 
      def execute(sql, name = nil) sql end
8
 
    end
9
 
  end
10
 
 
11
 
  def teardown
12
 
    ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:alias_method, :execute, :real_execute)
13
 
  end
14
 
 
15
 
  def test_create_database_with_encoding
16
 
    assert_equal %(CREATE DATABASE "matt" ENCODING = 'utf8'), create_database(:matt)
17
 
    assert_equal %(CREATE DATABASE "aimonetti" ENCODING = 'latin1'), create_database(:aimonetti, :encoding => :latin1)
18
 
  end
19
 
 
20
 
  private
21
 
    def method_missing(method_symbol, *arguments)
22
 
      ActiveRecord::Base.connection.send(method_symbol, *arguments)
23
 
    end
24
 
end