method

be_close

be_close(expected, delta)
public

Passes if actual == expected +/- delta

Example

  result.should be_close(3.0, 0.5)

1Note

This method is deprecated in rspec 2.0

miry ยท Dec 1, 20121 thank
  • be_close(1, 0.1) is deprecated.
  • please use be_within(0.1).of(1) instead.