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

- (Object) column

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

- (Object) failure_message



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

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

- (Boolean) matches?(column)

Returns:

  • (Boolean)


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

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

- (Object) negative_failure_message



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

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