Class: ErgomentumRspec::Matchers::Array::BeUnique
- Inherits:
-
Object
- Object
- ErgomentumRspec::Matchers::Array::BeUnique
- Defined in:
- lib/ergomentum_rspec/matchers/array/be_unique.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
- #matches?(actual) ⇒ Boolean
Instance Method Details
#description ⇒ Object
24 25 26 |
# File 'lib/ergomentum_rspec/matchers/array/be_unique.rb', line 24 def description "be unique" end |
#failure_message ⇒ Object
16 17 18 |
# File 'lib/ergomentum_rspec/matchers/array/be_unique.rb', line 16 def "expected array #{@actual.inspect} to be unique" end |
#failure_message_when_negated ⇒ Object
20 21 22 |
# File 'lib/ergomentum_rspec/matchers/array/be_unique.rb', line 20 def "expected array #{@actual.inspect} to be not unique" end |
#matches?(actual) ⇒ Boolean
11 12 13 14 |
# File 'lib/ergomentum_rspec/matchers/array/be_unique.rb', line 11 def matches?(actual) @actual = actual actual.find { |e| actual.count(e) == 1 } end |