Module MigrationTestHelper
In: lib/migration_test_helper.rb

Methods

Classes and Modules

Class MigrationTestHelper::Schema
Class MigrationTestHelper::Table

Public Class methods

sets the directory in which the migrations reside to be run with migrate

Public Instance methods

verifies the schema exactly matches the one specified (schema_info does not have to be specified)

  assert_schema do |s|
    s.table :dogs do |t|
      t.column :id,   :integer, :default => 2
      t.column :name, :string
    end
  end

verifies a single table exactly matches the one specified

  assert_table :dogs do |t|
    t.column :id,   :integer, :default => 2
    t.column :name, :string
  end

drops all tables in the database

executes your migrations

  migrate                # same as rake db:migrate

Options are:

  • :version - version to migrate to (same as VERSION=.. option to rake db:migrate)
  • :verbose - print migration status messages to STDOUT, defaults to false

[Validate]