Class: Matchers::Be

Inherits:
BaseMatcher show all
Defined in:
lib/pidgin_spec/matchers/be.rb

Instance Method Summary collapse

Methods inherited from BaseMatcher

#initialize

Constructor Details

This class inherits a constructor from Matchers::BaseMatcher

Instance Method Details

#failure_messageObject



12
13
14
# File 'lib/pidgin_spec/matchers/be.rb', line 12

def failure_message
  "I bin dey expect #{value} go be #{@expected} but e no be am at all"
end

#failure_message_when_negatedObject



8
9
10
# File 'lib/pidgin_spec/matchers/be.rb', line 8

def failure_message_when_negated
  "I bin dey expect say #{@value} no go be #{@expected}, but e con be #{@expected}"
end

#matches?(value) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
# File 'lib/pidgin_spec/matchers/be.rb', line 3

def matches?(value)
  @value = value
  @value.is_a? @expected
end