Class: Spec::Matchers::Migration::HaveColumnMatcher

### Home Classes Methods

### In Files

- lib/spec/matchers/migration_matchers.rb

### Parent

Object

### Methods

- ::new
- #failure_message
- #matches?
- #negative_failure_message

### 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::Matchers::Migration::HaveColumnMatcher

### Attributes

column_name[RW]
table[RW]

### Public Class Methods

new(column_name) click to toggle source

    # File lib/spec/matchers/migration_matchers.rb, line 47
    def initialize(column_name)
      @column_name = column_name
    end

### Public Instance Methods

failure_message() click to toggle source

    # File lib/spec/matchers/migration_matchers.rb, line 56
    def failure_message
      %(expected #{table} to have column '#{column_name}')
    end

matches?(table) click to toggle source

    # File lib/spec/matchers/migration_matchers.rb, line 51
    def matches?(table)
      @table = table
      table.columns.map { |c| c.name }.include?(column_name.to_s)
    end

negative_failure_message() click to toggle source

    # File lib/spec/matchers/migration_matchers.rb, line 60
    def negative_failure_message
      %(expected #{table} to not have column '#{column_name}')
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.