Class: Crspec::Matchers::BeTruthyMatcher

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

Instance Attribute Summary

Attributes inherited from BaseMatcher

#actual, #expected

Instance Method Summary collapse

Methods inherited from BaseMatcher

#failure_message_when_negated, #initialize

Constructor Details

This class inherits a constructor from Crspec::Matchers::BaseMatcher

Instance Method Details

#failure_messageObject



74
75
76
# File 'lib/crspec/matchers.rb', line 74

def failure_message
  "Expected #{@actual.inspect} to be truthy"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


69
70
71
72
# File 'lib/crspec/matchers.rb', line 69

def matches?(actual)
  @actual = actual
  !!@actual
end