From 28679fe09d6a2a9ee67cdabf66e5c1c521f99318 Mon Sep 17 00:00:00 2001 From: tompng Date: Sat, 31 May 2025 03:41:18 +0900 Subject: [PATCH] Skip coerce spec for BigDecimal#div In bigdecimal < 3.2.0, `bigdecimal.div(x, 0)` called `x.coerce` but `bigdecimal.div(x, nonzero)` doesn't call `coerce`. `bigdecimal.div(x,0)` was implemented by `bigdecimal/x`, and calling coerce was just a side effect. It's not a spec. --- library/bigdecimal/shared/quo.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/library/bigdecimal/shared/quo.rb b/library/bigdecimal/shared/quo.rb index 46e6d62bf4..18ff2fe9a5 100644 --- a/library/bigdecimal/shared/quo.rb +++ b/library/bigdecimal/shared/quo.rb @@ -31,6 +31,7 @@ describe "with Object" do it "tries to coerce the other operand to self" do + skip if @method == :div object = mock("Object") object.should_receive(:coerce).with(@one).and_return([@one, @two]) @one.send(@method, object, *@object).should == BigDecimal("0.5")