1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/integer/zero_spec.rb
2021-10-20 21:41:46 +02:00

21 lines
458 B
Ruby

require_relative '../../spec_helper'
describe "Integer#zero?" do
it "returns true if self is 0" do
0.should.zero?
1.should_not.zero?
-1.should_not.zero?
end
ruby_version_is "3.0" do
it "Integer#zero? overrides Numeric#zero?" do
42.method(:zero?).owner.should == Integer
end
end
ruby_version_is ""..."3.0" do
it "Integer#zero? uses Numeric#zero?" do
42.method(:zero?).owner.should == Numeric
end
end
end