diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-31 14:03:55 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-31 14:03:55 -0300 |
commit | b22c527e65a41da59dbfcb078968069c6fae5086 (patch) | |
tree | fd50b9a5b79cf2e3cd508032aec320c0280b5b99 /activerecord/test/cases | |
parent | 5e5107430bccc0a536e0b264c951793d8fe62235 (diff) | |
parent | cf4afc4d11556609802f640135cc7715e4a6a9fe (diff) | |
download | rails-b22c527e65a41da59dbfcb078968069c6fae5086.tar.gz rails-b22c527e65a41da59dbfcb078968069c6fae5086.tar.bz2 rails-b22c527e65a41da59dbfcb078968069c6fae5086.zip |
Merge branch 'minitest_cleanup'
Diffstat (limited to 'activerecord/test/cases')
12 files changed, 42 insertions, 42 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index d326ed7863..518ce9763c 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1484,7 +1484,7 @@ class BasicsTest < ActiveRecord::TestCase def test_column_types_typecast topic = Topic.first - refute_equal 't.lo', topic.author_name + assert_not_equal 't.lo', topic.author_name attrs = topic.attributes.dup attrs.delete 'id' diff --git a/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb b/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb index 1eb9bf60e1..1fd64dd0af 100644 --- a/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb +++ b/activerecord/test/cases/connection_adapters/abstract_adapter_test.rb @@ -10,18 +10,18 @@ module ActiveRecord end def test_in_use? - refute adapter.in_use?, 'adapter is not in use' + assert_not adapter.in_use?, 'adapter is not in use' assert adapter.lease, 'lease adapter' assert adapter.in_use?, 'adapter is in use' end def test_lease_twice assert adapter.lease, 'should lease adapter' - refute adapter.lease, 'should not lease adapter' + assert_not adapter.lease, 'should not lease adapter' end def test_last_use - refute adapter.last_use + assert_not adapter.last_use adapter.lease assert adapter.last_use end @@ -30,7 +30,7 @@ module ActiveRecord assert adapter.lease, 'lease adapter' assert adapter.in_use?, 'adapter is in use' adapter.expire - refute adapter.in_use?, 'adapter is in use' + assert_not adapter.in_use?, 'adapter is in use' end def test_close @@ -44,7 +44,7 @@ module ActiveRecord # Close should put the adapter back in the pool adapter.close - refute adapter.in_use? + assert_not adapter.in_use? assert_equal adapter, pool.connection end diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index 3a315d843b..5ffb32e809 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -2,8 +2,7 @@ require File.expand_path('../../../../load_paths', __FILE__) require 'config' -gem 'minitest' -require 'minitest/autorun' +require 'active_support/testing/autorun' require 'stringio' require 'active_record' diff --git a/activerecord/test/cases/migration/change_schema_test.rb b/activerecord/test/cases/migration/change_schema_test.rb index 86451289e7..4a3c48f750 100644 --- a/activerecord/test/cases/migration/change_schema_test.rb +++ b/activerecord/test/cases/migration/change_schema_test.rb @@ -293,7 +293,7 @@ module ActiveRecord end assert connection.column_exists?(:testings, :foo) - refute connection.column_exists?(:testings, :bar) + assert_not connection.column_exists?(:testings, :bar) end def test_column_exists_with_type @@ -303,10 +303,10 @@ module ActiveRecord end assert connection.column_exists?(:testings, :foo, :string) - refute connection.column_exists?(:testings, :foo, :integer) + assert_not connection.column_exists?(:testings, :foo, :integer) assert connection.column_exists?(:testings, :bar, :decimal) - refute connection.column_exists?(:testings, :bar, :integer) + assert_not connection.column_exists?(:testings, :bar, :integer) end def test_column_exists_with_definition @@ -318,13 +318,13 @@ module ActiveRecord end assert connection.column_exists?(:testings, :foo, :string, limit: 100) - refute connection.column_exists?(:testings, :foo, :string, limit: nil) + assert_not connection.column_exists?(:testings, :foo, :string, limit: nil) assert connection.column_exists?(:testings, :bar, :decimal, precision: 8, scale: 2) - refute connection.column_exists?(:testings, :bar, :decimal, precision: nil, scale: nil) + assert_not connection.column_exists?(:testings, :bar, :decimal, precision: nil, scale: nil) assert connection.column_exists?(:testings, :taggable_id, :integer, null: false) - refute connection.column_exists?(:testings, :taggable_id, :integer, null: true) + assert_not connection.column_exists?(:testings, :taggable_id, :integer, null: true) assert connection.column_exists?(:testings, :taggable_type, :string, default: 'Photo') - refute connection.column_exists?(:testings, :taggable_type, :string, default: nil) + assert_not connection.column_exists?(:testings, :taggable_type, :string, default: nil) end def test_column_exists_on_table_with_no_options_parameter_supplied diff --git a/activerecord/test/cases/migration/change_table_test.rb b/activerecord/test/cases/migration/change_table_test.rb index ac1ad176db..8065541bfe 100644 --- a/activerecord/test/cases/migration/change_table_test.rb +++ b/activerecord/test/cases/migration/change_table_test.rb @@ -1,4 +1,5 @@ require "cases/migration/helper" +require "minitest/mock" module ActiveRecord class Migration diff --git a/activerecord/test/cases/migration/column_attributes_test.rb b/activerecord/test/cases/migration/column_attributes_test.rb index b88db384a0..ec2926632c 100644 --- a/activerecord/test/cases/migration/column_attributes_test.rb +++ b/activerecord/test/cases/migration/column_attributes_test.rb @@ -16,7 +16,7 @@ module ActiveRecord end def test_add_remove_single_field_using_string_arguments - refute TestModel.column_methods_hash.key?(:last_name) + assert_not TestModel.column_methods_hash.key?(:last_name) add_column 'test_models', 'last_name', :string @@ -27,11 +27,11 @@ module ActiveRecord remove_column 'test_models', 'last_name' TestModel.reset_column_information - refute TestModel.column_methods_hash.key?(:last_name) + assert_not TestModel.column_methods_hash.key?(:last_name) end def test_add_remove_single_field_using_symbol_arguments - refute TestModel.column_methods_hash.key?(:last_name) + assert_not TestModel.column_methods_hash.key?(:last_name) add_column :test_models, :last_name, :string @@ -41,7 +41,7 @@ module ActiveRecord remove_column :test_models, :last_name TestModel.reset_column_information - refute TestModel.column_methods_hash.key?(:last_name) + assert_not TestModel.column_methods_hash.key?(:last_name) end def test_unabstracted_database_dependent_types diff --git a/activerecord/test/cases/migration/index_test.rb b/activerecord/test/cases/migration/index_test.rb index 0787414d8f..a41f2c10f0 100644 --- a/activerecord/test/cases/migration/index_test.rb +++ b/activerecord/test/cases/migration/index_test.rb @@ -35,7 +35,7 @@ module ActiveRecord connection.rename_index(table_name, 'old_idx', 'new_idx') # if the adapter doesn't support the indexes call, pick defaults that let the test pass - refute connection.index_name_exists?(table_name, 'old_idx', false) + assert_not connection.index_name_exists?(table_name, 'old_idx', false) assert connection.index_name_exists?(table_name, 'new_idx', true) end @@ -63,7 +63,7 @@ module ActiveRecord connection.add_index(table_name, "foo", :name => too_long_index_name) } - refute connection.index_name_exists?(table_name, too_long_index_name, false) + assert_not connection.index_name_exists?(table_name, too_long_index_name, false) connection.add_index(table_name, "foo", :name => good_index_name) assert connection.index_name_exists?(table_name, good_index_name, false) @@ -75,7 +75,7 @@ module ActiveRecord assert connection.index_exists?(table_name, :foo, :name => :symbol_index_name) connection.remove_index table_name, :name => :symbol_index_name - refute connection.index_exists?(table_name, :foo, :name => :symbol_index_name) + assert_not connection.index_exists?(table_name, :foo, :name => :symbol_index_name) end def test_index_exists diff --git a/activerecord/test/cases/migration/references_index_test.rb b/activerecord/test/cases/migration/references_index_test.rb index 264a99f9ce..3ff89524fe 100644 --- a/activerecord/test/cases/migration/references_index_test.rb +++ b/activerecord/test/cases/migration/references_index_test.rb @@ -29,7 +29,7 @@ module ActiveRecord t.references :foo end - refute connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) + assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end def test_does_not_create_index_explicit @@ -37,7 +37,7 @@ module ActiveRecord t.references :foo, :index => false end - refute connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) + assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end def test_creates_index_with_options @@ -75,7 +75,7 @@ module ActiveRecord t.references :foo end - refute connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) + assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end def test_does_not_create_index_for_existing_table_explicit @@ -84,7 +84,7 @@ module ActiveRecord t.references :foo, :index => false end - refute connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) + assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end def test_creates_polymorphic_index_for_existing_table diff --git a/activerecord/test/cases/migration/references_statements_test.rb b/activerecord/test/cases/migration/references_statements_test.rb index d8a6565d54..e9545f2cce 100644 --- a/activerecord/test/cases/migration/references_statements_test.rb +++ b/activerecord/test/cases/migration/references_statements_test.rb @@ -22,7 +22,7 @@ module ActiveRecord def test_does_not_create_reference_type_column add_reference table_name, :taggable - refute column_exists?(table_name, :taggable_type, :string) + assert_not column_exists?(table_name, :taggable_type, :string) end def test_creates_reference_type_column @@ -37,7 +37,7 @@ module ActiveRecord def test_does_not_create_reference_id_index add_reference table_name, :user - refute index_exists?(table_name, :user_id) + assert_not index_exists?(table_name, :user_id) end def test_creates_polymorphic_index @@ -57,19 +57,19 @@ module ActiveRecord def test_deletes_reference_id_column remove_reference table_name, :supplier - refute column_exists?(table_name, :supplier_id, :integer) + assert_not column_exists?(table_name, :supplier_id, :integer) end def test_deletes_reference_id_index remove_reference table_name, :supplier - refute index_exists?(table_name, :supplier_id) + assert_not index_exists?(table_name, :supplier_id) end def test_does_not_delete_reference_type_column with_polymorphic_column do remove_reference table_name, :supplier - refute column_exists?(table_name, :supplier_id, :integer) + assert_not column_exists?(table_name, :supplier_id, :integer) assert column_exists?(table_name, :supplier_type, :string) end end @@ -77,14 +77,14 @@ module ActiveRecord def test_deletes_reference_type_column with_polymorphic_column do remove_reference table_name, :supplier, polymorphic: true - refute column_exists?(table_name, :supplier_type, :string) + assert_not column_exists?(table_name, :supplier_type, :string) end end def test_deletes_polymorphic_index with_polymorphic_column do remove_reference table_name, :supplier, polymorphic: true - refute index_exists?(table_name, [:supplier_id, :supplier_type]) + assert_not index_exists?(table_name, [:supplier_id, :supplier_type]) end end @@ -95,7 +95,7 @@ module ActiveRecord def test_remove_belongs_to_alias remove_belongs_to table_name, :supplier - refute column_exists?(table_name, :supplier_id, :integer) + assert_not column_exists?(table_name, :supplier_id, :integer) end private diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index c155f29973..9cb64a6a71 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -232,7 +232,7 @@ class MigrationTest < ActiveRecord::TestCase skip "not supported on #{ActiveRecord::Base.connection.class}" end - refute Person.column_methods_hash.include?(:last_name) + assert_not Person.column_methods_hash.include?(:last_name) migration = Struct.new(:name, :version) { def migrate(x); raise 'Something broke'; end @@ -245,7 +245,7 @@ class MigrationTest < ActiveRecord::TestCase assert_equal "An error has occurred, this and all later migrations canceled:\n\nSomething broke", e.message Person.reset_column_information - refute Person.column_methods_hash.include?(:last_name) + assert_not Person.column_methods_hash.include?(:last_name) end def test_schema_migrations_table_name diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index 199d0c584b..e905006570 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -121,11 +121,11 @@ module ActiveRecord ActiveRecord::Migrator.new(:up, pass_one).migrate assert pass_one.first.went_up - refute pass_one.first.went_down + assert_not pass_one.first.went_down pass_two = [Sensor.new('One', 1), Sensor.new('Three', 3)] ActiveRecord::Migrator.new(:up, pass_two).migrate - refute pass_two[0].went_up + assert_not pass_two[0].went_up assert pass_two[1].went_up assert pass_two.all? { |x| !x.went_down } @@ -135,7 +135,7 @@ module ActiveRecord ActiveRecord::Migrator.new(:down, pass_three).migrate assert pass_three[0].went_down - refute pass_three[1].went_down + assert_not pass_three[1].went_down assert pass_three[2].went_down end @@ -307,7 +307,7 @@ module ActiveRecord _, migrator = migrator_class(3) ActiveRecord::Base.connection.execute("DROP TABLE schema_migrations") - refute ActiveRecord::Base.connection.table_exists?('schema_migrations') + assert_not ActiveRecord::Base.connection.table_exists?('schema_migrations') migrator.migrate("valid", 1) assert ActiveRecord::Base.connection.table_exists?('schema_migrations') end diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index fdca10f4fb..0c8b372e79 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -15,7 +15,7 @@ class TransactionTest < ActiveRecord::TestCase end def test_raise_after_destroy - refute @first.frozen? + assert_not @first.frozen? assert_raises(RuntimeError) { Topic.transaction do @@ -26,7 +26,7 @@ class TransactionTest < ActiveRecord::TestCase } assert @first.reload - refute @first.frozen? + assert_not @first.frozen? end def test_successful |