Class: Spec::Example::MigrationExampleGroup

### Home Classes Methods

### In Files

- lib/spec/example/migration_example_group.rb

### Parent

Spec::Example::ExampleGroup

### Methods

- #all_databases
- #migration_name
- #run_migration
- #run_prereq_migrations
- #select
- #table
- #this_migration

### Included Modules

- Spec::Matchers::Migration

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Adapters
- DataMapper::Migration
- DataMapper::MigrationRunner
- DataMapper::Migrations
- DataMapper::Migrations::DataObjectsAdapter
- DataMapper::Migrations::DataObjectsAdapter::ClassMethods
- DataMapper::Migrations::DuplicateMigration
- DataMapper::Migrations::Model
- DataMapper::Migrations::MysqlAdapter
- DataMapper::Migrations::MysqlAdapter::ClassMethods
- DataMapper::Migrations::OracleAdapter
- DataMapper::Migrations::OracleAdapter::ClassMethods
- DataMapper::Migrations::PostgresAdapter
- DataMapper::Migrations::PostgresAdapter::ClassMethods
- DataMapper::Migrations::Repository
- DataMapper::Migrations::SingletonMethods
- DataMapper::Migrations::SqliteAdapter
- DataMapper::Migrations::SqliteAdapter::ClassMethods
- DataMapper::Migrations::SqlserverAdapter
- DataMapper::Migrations::SqlserverAdapter::ClassMethods
- DataMapper::Migrations::YamlAdapter
- SQL
- SQL::Column
- SQL::Mysql
- SQL::Mysql::Column
- SQL::Mysql::Table
- SQL::Postgres
- SQL::Postgres::Column
- SQL::Postgres::Table
- SQL::Sqlite
- SQL::Sqlite::Column
- SQL::Sqlite::Table
- SQL::Table
- SQL::TableCreator
- SQL::TableCreator::Column
- SQL::TableCreator::SqlExpr
- SQL::TableModifier
- Spec
- Spec::Example
- Spec::Example::MigrationExampleGroup
- Spec::Matchers
- Spec::Matchers::Migration
- Spec::Matchers::Migration::HaveColumnMatcher
- Spec::Matchers::Migration::HaveTableMatcher
- Spec::Matchers::Migration::NullableColumnMatcher
- Spec::Matchers::Migration::PrimaryKeyMatcher
- Object

No matching classes.

# Spec::Example::MigrationExampleGroup

### Public Instance Methods

all_databases() click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 53
    def all_databases
      @@migrations.map { |m| m.database }.uniq
    end

migration_name() click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 49
    def migration_name
      @migration_name ||= self.class.instance_variable_get("@description_text").to_s
    end

run_migration() click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 45
    def run_migration
      this_migration.perform_up
    end

run_prereq_migrations() click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 34
    def run_prereq_migrations
      "running n-1 migrations"
      all_databases.each do |db|
        db.adapter.recreate_database
      end
      @@migrations.sort.each do |migration|
        break if migration.name.to_s == migration_name.to_s
        migration.perform_up
      end
    end

select(sql) click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 61
    def select(sql)
      this_migration.adapter.select(sql)
    end

table(table_name) click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 65
    def table(table_name)
      this_migration.adapter.table(table_name)
    end

this_migration() click to toggle source

    # File lib/spec/example/migration_example_group.rb, line 57
    def this_migration
      @@migrations.select { |m| m.name.to_s == migration_name }.first
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.