Class: Matchi::BeWithin
- Inherits:
-
Object
- Object
- Matchi::BeWithin
- Defined in:
- lib/matchi/be_within.rb,
lib/matchi/be_within/of.rb
Overview
Wraps the target of a be_within matcher.
Defined Under Namespace
Classes: Of
Instance Method Summary collapse
-
#initialize(delta) ⇒ BeWithin
constructor
Initialize a wrapper of the be_within matcher with a numeric value.
-
#of(expected) ⇒ #match?
Specifies an expected numeric value.
Constructor Details
#initialize(delta) ⇒ BeWithin
Initialize a wrapper of the be_within matcher with a numeric value.
16 17 18 19 20 21 |
# File 'lib/matchi/be_within.rb', line 16 def initialize(delta) raise ::ArgumentError, "delta must be a Numeric" unless delta.is_a?(::Numeric) raise ::ArgumentError, "delta must be non-negative" if delta.negative? @delta = delta end |