Class: Minicrest::IsGreaterThanOrEqualTo

Inherits:
ComparisonMatcher show all
Defined in:
lib/minicrest/is_greater_than_or_equal_to.rb

Overview

Matcher that checks if a value is greater than or equal to an expected value.

Works with any objects that support the >= operator.

Examples:

Basic usage

is_greater_than_or_equal_to(5).matches?(10)  # => true
is_greater_than_or_equal_to(5).matches?(5)   # => true
is_greater_than_or_equal_to(5).matches?(3)   # => false

See Also:

Instance Method Summary collapse

Methods inherited from ComparisonMatcher

#description, #failure_message, #matches?, #negated_failure_message

Methods inherited from Matcher

#&, #description, #failure_message, #matches?, #negated_failure_message, #|

Constructor Details

#initialize(expected) ⇒ IsGreaterThanOrEqualTo

Creates a new greater-than-or-equal-to matcher.

Parameters:

  • expected (Comparable)

    the value to compare against



19
20
21
# File 'lib/minicrest/is_greater_than_or_equal_to.rb', line 19

def initialize(expected)
  super(expected, :>=, 'greater than or equal to')
end