Exception: Shoulda::Matchers::ActiveModel::AllowValueMatcher::AttributeDoesNotExistError

Inherits:
Error
  • Object
show all
Defined in:
lib/shoulda/matchers/active_model/allow_value_matcher/attribute_does_not_exist_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

create, #initialize, #inspect

Constructor Details

This class inherits a constructor from Shoulda::Matchers::Error

Instance Attribute Details

#attribute_nameObject

Returns the value of attribute attribute_name.



7
8
9
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_does_not_exist_error.rb', line 7

def attribute_name
  @attribute_name
end

#modelObject

Returns the value of attribute model.



7
8
9
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_does_not_exist_error.rb', line 7

def model
  @model
end

#valueObject

Returns the value of attribute value.



7
8
9
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_does_not_exist_error.rb', line 7

def value
  @value
end

Instance Method Details

#messageObject



9
10
11
12
13
14
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_does_not_exist_error.rb', line 9

def message
  Shoulda::Matchers.word_wrap <<-MESSAGE
The matcher attempted to set :#{attribute_name} on the #{model.name} to
#{value.inspect}, but that attribute does not exist.
  MESSAGE
end

#successful?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/shoulda/matchers/active_model/allow_value_matcher/attribute_does_not_exist_error.rb', line 16

def successful?
  false
end