Module: Philiprehberger::Approx::RSpecMatchers
- Defined in:
- lib/philiprehberger/approx/rspec_matchers.rb
Defined Under Namespace
Classes: BeApproxMatcher, BeApproxWithinMatcher
Instance Method Summary collapse
-
#be_approx(expected, epsilon: Float::EPSILON) ⇒ Object
Matcher for approximate equality using epsilon.
-
#be_approx_within(expected, abs: nil, rel: nil, percent: nil) ⇒ Object
Matcher for approximate equality using abs, rel, or percent tolerance.
Instance Method Details
#be_approx(expected, epsilon: Float::EPSILON) ⇒ Object
Matcher for approximate equality using epsilon
11 12 13 |
# File 'lib/philiprehberger/approx/rspec_matchers.rb', line 11 def be_approx(expected, epsilon: Float::EPSILON) BeApproxMatcher.new(expected, epsilon) end |
#be_approx_within(expected, abs: nil, rel: nil, percent: nil) ⇒ Object
Matcher for approximate equality using abs, rel, or percent tolerance
21 22 23 |
# File 'lib/philiprehberger/approx/rspec_matchers.rb', line 21 def be_approx_within(expected, abs: nil, rel: nil, percent: nil) BeApproxWithinMatcher.new(expected, abs, rel, percent) end |