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/float/negative_spec.rb
2020-08-28 20:26:02 +02:00

33 lines
614 B
Ruby

require_relative '../../spec_helper'
describe "Float#negative?" do
describe "on positive numbers" do
it "returns false" do
0.1.negative?.should be_false
end
end
describe "on zero" do
it "returns false" do
0.0.negative?.should be_false
end
end
describe "on negative zero" do
it "returns false" do
-0.0.negative?.should be_false
end
end
describe "on negative numbers" do
it "returns true" do
-0.1.negative?.should be_true
end
end
describe "on NaN" do
it "returns false" do
nan_value.negative?.should be_false
end
end
end