instance method assert_migration

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.2.22.5

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

assert_migration(relative, *contents, &block)

Asserts a given file does not exist. You need to supply an absolute path or a path relative to the configured destination:

assert_migration "db/migrate/create_products.rb"

This method manipulates the given path and tries to find any migration which matches the migration name. For example, the call above is converted to:

assert_file "db/migrate/003_create_products.rb"

Consequently, assert_migration accepts the same arguments has assert_file.

Parameters

relative req
contents rest
block block
Source
# File railties/lib/rails/generators/test_case.rb, line 147
      def assert_migration(relative, *contents, &block)
        file_name = migration_file_name(relative)
        assert file_name, "Expected migration #{relative} to exist, but was not found"
        assert_file file_name, *contents, &block
      end

Defined in railties/lib/rails/generators/test_case.rb line 147 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generators::TestCase

Type at least 2 characters to search.

↑↓ navigate · open · esc close