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.



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

def column
  @column
end

Instance Method Details

#failure_messageObject



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

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

#matches?(column) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#negative_failure_messageObject



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

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