aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/bigdecimal/plus_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/bigdecimal/plus_spec.rb')
-rw-r--r--spec/ruby/library/bigdecimal/plus_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/library/bigdecimal/plus_spec.rb b/spec/ruby/library/bigdecimal/plus_spec.rb
index 9247ff6146..cefc43aeaa 100644
--- a/spec/ruby/library/bigdecimal/plus_spec.rb
+++ b/spec/ruby/library/bigdecimal/plus_spec.rb
@@ -44,4 +44,11 @@ describe "BigDecimal#+" do
(@infinity + @infinity_minus).nan?.should == true
end
+ describe "with Object" do
+ it "tries to coerce the other operand to self" do
+ object = mock("Object")
+ object.should_receive(:coerce).with(@one).and_return([@one, BigDecimal("42")])
+ (@one + object).should == BigDecimal("43")
+ end
+ end
end