spec/spec_helper.rb in standard_deviation-1.0.0 vs spec/spec_helper.rb in standard_deviation-1.0.1
- old
+ new
@@ -1,2 +1,8 @@
require "standard_deviation"
require "bigdecimal"
+
+RSpec::Matchers.define :be_close_to do |expected|
+ match do |actual|
+ BigDecimal.new(actual.to_s).round(10) == BigDecimal.new(expected.to_s).round(10)
+ end
+end