Permalink
Browse files

stop more ddl changes

  • Loading branch information...
tenderlove committed Jan 16, 2012
1 parent 86a73cd commit 21afd9b96d70d1e2b1cffdfb60f7ec64ab240472
Showing with 16 additions and 14 deletions.
  1. +0 −14 activerecord/test/cases/migration_test.rb
  2. +16 −0 activerecord/test/cases/migrator_test.rb
@@ -233,20 +233,6 @@ def migrate(x); raise 'Something broke'; end
refute Person.column_methods_hash.include?(:last_name)
end
- def test_get_all_versions
- ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
- assert_equal([1,2,3], ActiveRecord::Migrator.get_all_versions)
-
- ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
- assert_equal([1,2], ActiveRecord::Migrator.get_all_versions)
-
- ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
- assert_equal([1], ActiveRecord::Migrator.get_all_versions)
-
- ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
- assert_equal([], ActiveRecord::Migrator.get_all_versions)
- end
-
def test_schema_migrations_table_name
ActiveRecord::Base.table_name_prefix = "prefix_"
ActiveRecord::Base.table_name_suffix = "_suffix"
@@ -328,6 +328,22 @@ def test_only_loads_pending_migrations
assert_equal [[:up, 2], [:up, 3]], calls
end
+ def test_get_all_versions
+ _, migrator = migrator_class(3)

This comment has been minimized.

Show comment
Hide comment
@gmile

gmile Jan 17, 2012

Contributor

Given migrator_class returns an array of two values, why doing a mass assignment with a not so used _?

@gmile

gmile Jan 17, 2012

Contributor

Given migrator_class returns an array of two values, why doing a mass assignment with a not so used _?

This comment has been minimized.

Show comment
Hide comment
@tenderlove

tenderlove Jan 17, 2012

Member

shrug. Please send patches! :-)

@tenderlove

tenderlove Jan 17, 2012

Member

shrug. Please send patches! :-)

+
+ migrator.migrate("valid")
+ assert_equal([1,2,3], ActiveRecord::Migrator.get_all_versions)
+
+ migrator.rollback("valid")
+ assert_equal([1,2], ActiveRecord::Migrator.get_all_versions)
+
+ migrator.rollback("valid")
+ assert_equal([1], ActiveRecord::Migrator.get_all_versions)
+
+ migrator.rollback("valid")
+ assert_equal([], ActiveRecord::Migrator.get_all_versions)
+ end
+
private
def m(name, version, &block)
x = Sensor.new name, version

0 comments on commit 21afd9b

Please sign in to comment.