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

#and, #failure_message_when_negated, #initialize, #or

Constructor Details

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

Instance Method Details

#failure_messageObject



135
136
137
# File 'lib/crspec/matchers.rb', line 135

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


130
131
132
133
# File 'lib/crspec/matchers.rb', line 130

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