mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@d6921ef
This commit is contained in:
parent
207a5a5bc1
commit
a6c6eef04a
44 changed files with 1141 additions and 250 deletions
21
spec/ruby/core/integer/zero_spec.rb
Normal file
21
spec/ruby/core/integer/zero_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue