Consider using be_close from rspec for comparison to floating point values.