Class: Spec::Matchers::Migration::PrimaryKeyMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/matchers/migration_matchers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnObject

Returns the value of attribute column.



88
89
90
# File 'lib/spec/matchers/migration_matchers.rb', line 88

def column
  @column
end

Instance Method Details

#failure_messageObject



95
96
97
# File 'lib/spec/matchers/migration_matchers.rb', line 95

def failure_message
  %(expected #{column.name} to be PRIMARY KEY)
end

#matches?(column) ⇒ Boolean

Returns:

  • (Boolean)


90
91
92
93
# File 'lib/spec/matchers/migration_matchers.rb', line 90

def matches?(column)
  @column = column
  column.primary_key
end

#negative_failure_messageObject



99
100
101
# File 'lib/spec/matchers/migration_matchers.rb', line 99

def negative_failure_message
  %(expected #{column.name} to not be PRIMARY KEY)
end