Class: SequelSpec::Matchers::Validation::ValidateUniqueMatcher

Inherits:
ValidateMatcher show all
Defined in:
lib/sequel_spec/validation/validate_unique_matcher.rb

Instance Method Summary collapse

Methods inherited from ValidateMatcher

#additionnal_param_required?, #allowing_blank, #allowing_missing, #allowing_nil, #valid?, #with_message

Methods inherited from Base

#failure_message, #hash_to_nice_string, #initialize, #matches?, #negative_failure_message, #with_options

Constructor Details

This class inherits a constructor from SequelSpec::Matchers::Base

Instance Method Details

#args_to_called_attributes(args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/sequel_spec/validation/validate_unique_matcher.rb', line 15

def args_to_called_attributes(args)
  called_attributes = []
  until args.empty?
    called_attributes << args.shift
  end
  called_attributes
end

#descriptionObject



5
6
7
8
9
# File 'lib/sequel_spec/validation/validate_unique_matcher.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

#validation_typeObject



11
12
13
# File 'lib/sequel_spec/validation/validate_unique_matcher.rb', line 11

def validation_type
  :validates_unique
end