diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-01-30 12:21:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 12:21:43 -0500 |
commit | ede6673f9b8ea9567e300a6bd68ba14f48651c08 (patch) | |
tree | 4391c4099912c1526ce6c70e83973c319bccb7b6 /activerecord/test | |
parent | de2bca4e8513d59c1a4f131e6fc6386231db1f82 (diff) | |
parent | 6e49cc77ab3d16c06e12f93158eaf3e507d4120e (diff) | |
download | rails-ede6673f9b8ea9567e300a6bd68ba14f48651c08.tar.gz rails-ede6673f9b8ea9567e300a6bd68ba14f48651c08.tar.bz2 rails-ede6673f9b8ea9567e300a6bd68ba14f48651c08.zip |
Merge pull request #27787 from y-yagi/show_correct_class_name_in_migration_error
show correct class name in migration inherited directly error
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/migration/compatibility_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration/compatibility_test.rb b/activerecord/test/cases/migration/compatibility_test.rb index e5a7412bc3..9296f3da90 100644 --- a/activerecord/test/cases/migration/compatibility_test.rb +++ b/activerecord/test/cases/migration/compatibility_test.rb @@ -103,9 +103,10 @@ module ActiveRecord end def test_legacy_migrations_raises_exception_when_inherited - assert_raises(StandardError) do - Class.new(ActiveRecord::Migration) + e = assert_raises(StandardError) do + class_eval("class LegacyMigration < ActiveRecord::Migration; end") end + assert_match(/LegacyMigration < ActiveRecord::Migration\[4\.2\]/, e.message) end end end |