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.



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

def column
  @column
end

Instance Method Details

#failure_messageObject



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

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

#matches?(column) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#negative_failure_messageObject



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

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