Class: Crspec::Matchers::BeFalsyMatcher

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



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

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
83
# File 'lib/crspec/matchers.rb', line 80

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