diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-01-15 13:03:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 13:03:27 +0900 |
commit | 71ce7e1825c5b8fe08dd96cd77c6a379afd34256 (patch) | |
tree | 58ddc2eed52edc772fa0a21704d1c24d7aa81a22 /spec/ruby/core | |
parent | 1ddeb7473d231fa68bd972442937e9fb5c994cb5 (diff) | |
download | ruby-71ce7e1825c5b8fe08dd96cd77c6a379afd34256.tar.gz |
[Bug #19335] `Integer#remainder` should respect `#coerce` (#7120)
Also `Numeric#remainder` should.
Diffstat (limited to 'spec/ruby/core')
-rw-r--r-- | spec/ruby/core/numeric/remainder_spec.rb | 3 |
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 |