diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-18 15:12:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-19 10:24:15 -0800 |
commit | 96b50a039276b4391ddf07b0a74850ce7bad6863 (patch) | |
tree | a1bb5eff45e86cbbe78639883c885ccee1f9d147 /activerecord/test/cases/migration/command_recorder_test.rb | |
parent | b29a24bb6f13b8af9c12b77ee0ddc1f84c79ab55 (diff) | |
download | rails-96b50a039276b4391ddf07b0a74850ce7bad6863.tar.gz rails-96b50a039276b4391ddf07b0a74850ce7bad6863.tar.bz2 rails-96b50a039276b4391ddf07b0a74850ce7bad6863.zip |
IrreversibleMigration is raised if we cannot invert the command
Diffstat (limited to 'activerecord/test/cases/migration/command_recorder_test.rb')
-rw-r--r-- | activerecord/test/cases/migration/command_recorder_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/command_recorder_test.rb b/activerecord/test/cases/migration/command_recorder_test.rb index 47c3332078..50d75e0400 100644 --- a/activerecord/test/cases/migration/command_recorder_test.rb +++ b/activerecord/test/cases/migration/command_recorder_test.rb @@ -7,6 +7,13 @@ module ActiveRecord @recorder = CommandRecorder.new end + def test_unknown_commands_raise_exception + @recorder.record :execute, ['some sql'] + assert_raises(ActiveRecord::IrreversibleMigration) do + @recorder.inverse + end + end + def test_record @recorder.record :create_table, [:system_settings] assert_equal 1, @recorder.commands.length |