diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/adapter_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/connections/native_oracle/connection.rb | 2 | ||||
-rw-r--r-- | activerecord/test/migration_test.rb | 14 |
3 files changed, 11 insertions, 7 deletions
diff --git a/activerecord/test/adapter_test.rb b/activerecord/test/adapter_test.rb index 772dd0e5a8..c4027b31cb 100644 --- a/activerecord/test/adapter_test.rb +++ b/activerecord/test/adapter_test.rb @@ -42,7 +42,7 @@ class AdapterTest < Test::Unit::TestCase def test_current_database if @connection.respond_to?(:current_database) - assert_equal "activerecord_unittest", @connection.current_database + assert_equal ENV['ARUNIT_DB_NAME'] || "activerecord_unittest", @connection.current_database end end diff --git a/activerecord/test/connections/native_oracle/connection.rb b/activerecord/test/connections/native_oracle/connection.rb index 095fe9d5ee..b0d9696a70 100644 --- a/activerecord/test/connections/native_oracle/connection.rb +++ b/activerecord/test/connections/native_oracle/connection.rb @@ -6,7 +6,7 @@ ActiveRecord::Base.logger = Logger.new STDOUT ActiveRecord::Base.logger.level = Logger::WARN # Set these to your database connection strings -db = 'activerecord_unit_tests' +db = ENV['ARUNIT_DB'] || 'activerecord_unittest' ActiveRecord::Base.establish_connection( :adapter => 'oracle', diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb index cbcc29fdec..7c19b07447 100644 --- a/activerecord/test/migration_test.rb +++ b/activerecord/test/migration_test.rb @@ -257,8 +257,8 @@ if ActiveRecord::Base.connection.supports_migrations? assert_nothing_raised do if current_adapter?(:OracleAdapter) - # Oracle requires the explicit sequence for the pk - ActiveRecord::Base.connection.execute "INSERT INTO octopi (id, url) VALUES (octopi_seq.nextval, 'http://www.foreverflying.com/octopus-black7.jpg')" + # Oracle requires the explicit sequence value for the pk + ActiveRecord::Base.connection.execute "INSERT INTO octopi (id, url) VALUES (1, 'http://www.foreverflying.com/octopus-black7.jpg')" else ActiveRecord::Base.connection.execute "INSERT INTO octopi (url) VALUES ('http://www.foreverflying.com/octopus-black7.jpg')" end @@ -466,9 +466,13 @@ if ActiveRecord::Base.connection.supports_migrations? columns = Person.connection.columns(:binary_testings) data_column = columns.detect { |c| c.name == "data" } - - assert_equal "", data_column.default - + + if current_adapter?(:OracleAdapter) + assert_equal "empty_blob()", data_column.default + else + assert_equal "", data_column.default + end + Person.connection.drop_table :binary_testings rescue nil end |