Skip to content
Browse files

stop more ddl changes

  • Loading branch information...
1 parent 86a73cd commit 21afd9b96d70d1e2b1cffdfb60f7ec64ab240472 @tenderlove tenderlove committed
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
View
14 activerecord/test/cases/migration_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"
View
16 activerecord/test/cases/migrator_test.rb
@@ -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)
@gmile
gmile added a note

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

@tenderlove Ruby on Rails member

shrug. Please send patches! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+ 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.
Something went wrong with that request. Please try again.