Class: Spec::Matchers::Migration::NullableColumnMatcher

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.



68
69
70
# File 'lib/spec/matchers/migration_matchers.rb', line 68

def column
  @column
end

Instance Method Details

#failure_messageObject



75
76
77
# File 'lib/spec/matchers/migration_matchers.rb', line 75

def failure_message
  %(expected #{column.name} to permit NULL)
end

#matches?(column) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
73
# File 'lib/spec/matchers/migration_matchers.rb', line 70

def matches?(column)
  @column = column
  ! column.not_null
end

#negative_failure_messageObject



79
80
81
# File 'lib/spec/matchers/migration_matchers.rb', line 79

def negative_failure_message
  %(expected #{column.name} to be NOT NULL)
end