Class: RspecSequel::Matchers::ValidateUniqueMatcher
Instance Method Summary
collapse
Methods inherited from Validation
#additionnal_param_required?, #additionnal_param_type, #initialize, #valid?
Methods inherited from Base
#failure_message, #failure_message_when_negated, #hash_to_nice_string, #initialize, #matches?
Instance Method Details
#args_to_called_attributes(args) ⇒ Object
19
20
21
22
23
24
25
|
# File 'lib/rspec_sequel/matchers/validate_unique.rb', line 19
def args_to_called_attributes(args)
called_attributes = []
until args.empty?
called_attributes << args.shift
end
called_attributes
end
|
#description ⇒ Object
5
6
7
8
9
|
# File 'lib/rspec_sequel/matchers/validate_unique.rb', line 5
def description
desc = "validate uniqueness of #{@attribute.inspect}"
desc << " with option(s) #{hash_to_nice_string @options}" unless @options.empty?
desc
end
|
#valid_options ⇒ Object
15
16
17
|
# File 'lib/rspec_sequel/matchers/validate_unique.rb', line 15
def valid_options
[:message]
end
|
#validation_type ⇒ Object
11
12
13
|
# File 'lib/rspec_sequel/matchers/validate_unique.rb', line 11
def validation_type
:validates_unique
end
|