Skip to content

Commit

Permalink
stop more ddl changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 16, 2012
1 parent 86a73cd commit 21afd9b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
14 changes: 0 additions & 14 deletions activerecord/test/cases/migration_test.rb
Expand Up @@ -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"
Expand Down
16 changes: 16 additions & 0 deletions activerecord/test/cases/migrator_test.rb
Expand Up @@ -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.

Copy link
@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.

Copy link
@tenderlove

tenderlove Jan 17, 2012

Author 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
Expand Down

0 comments on commit 21afd9b

Please sign in to comment.