diff --git a/test/lib/migrator_test.rb b/test/lib/migrator_test.rb
index <HASH>..<HASH> 100644
--- a/test/lib/migrator_test.rb
+++ b/test/lib/migrator_test.rb
@@ -21,7 +21,7 @@ class MigratorTest < ActiveSupport::TestCase
 
   sub_test_case '.run_migrations' do
     setup do
-      FileUtils.touch Rails.root.join('db/migrate/20999999999999_create_foobars.rb')
+      File.write Rails.root.join('db/migrate/20999999999999_create_foobars.rb'), 'class CreateFoobars < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration; end'
       mock(ActiveRecord::Migrator).run(:up, ['db/migrate'], 20999999999999)
       mock(ActiveRecord::SchemaDumper).dump(ActiveRecord::Base.connection, anything)
     end
AR <I> requires each migration file to define a real migration class