summaryrefslogtreecommitdiff
path: root/spec/ruby/core/numeric
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-15 13:03:27 +0900
committerGitHub <noreply@github.com>2023-01-15 13:03:27 +0900
commit71ce7e1825c5b8fe08dd96cd77c6a379afd34256 (patch)
tree58ddc2eed52edc772fa0a21704d1c24d7aa81a22 /spec/ruby/core/numeric
parent1ddeb7473d231fa68bd972442937e9fb5c994cb5 (diff)
[Bug #19335] `Integer#remainder` should respect `#coerce` (#7120)
Also `Numeric#remainder` should.
Notes
Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
Diffstat (limited to 'spec/ruby/core/numeric')
-rw-r--r--spec/ruby/core/numeric/remainder_spec.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/ruby/core/numeric/remainder_spec.rb b/spec/ruby/core/numeric/remainder_spec.rb
index 1e2f5f3a96..674fa22d8e 100644
--- a/spec/ruby/core/numeric/remainder_spec.rb
+++ b/spec/ruby/core/numeric/remainder_spec.rb
@@ -6,6 +6,9 @@ describe "Numeric#remainder" do
@obj = NumericSpecs::Subclass.new
@result = mock("Numeric#% result")
@other = mock("Passed Object")
+ ruby_version_is "3.3" do
+ @other.should_receive(:coerce).with(@obj).and_return([@obj, @other])
+ end
end
it "returns the result of calling self#% with other if self is 0" do