Class: Polyrun::Quick::TruthyMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/polyrun/quick/matchers.rb

Instance Method Summary collapse

Instance Method Details

#does_not_match?(actual) ⇒ Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/polyrun/quick/matchers.rb', line 77

def does_not_match?(actual)
  !matches?(actual)
end

#failure_message(actual) ⇒ Object



81
82
83
# File 'lib/polyrun/quick/matchers.rb', line 81

def failure_message(actual)
  "expected truthy, got #{actual.inspect}"
end

#failure_message_when_negated(actual) ⇒ Object



85
86
87
# File 'lib/polyrun/quick/matchers.rb', line 85

def failure_message_when_negated(actual)
  "expected falsey, got #{actual.inspect}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/polyrun/quick/matchers.rb', line 73

def matches?(actual)
  !!actual
end