Permalink
Browse files

Compare to Float::INFINITY instead of using 'infinite?' method to bet…

…ter match labels of the cases.
  • Loading branch information...
1 parent 3d05972 commit b417d7b04c162d51b677a4b66a8383db1b93886a @r-stu31 committed May 3, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 spec/ruby/core/math/gamma_spec.rb
@@ -3,7 +3,7 @@
ruby_version_is "1.9" do
describe "Math.gamma" do
it "returns +infinity given 0" do
- Math.gamma(0).infinite?.should == 1
+ Math.gamma(0).should == Float::INFINITY
end
it "returns Math.sqrt(Math::PI) given 0.5" do
@@ -39,11 +39,11 @@
# See http://redmine.ruby-lang.org/issues/show/2189
it "returns +infinity given +infinity" do
- Math.gamma(infinity_value).infinite?.should == 1
+ Math.gamma(Float::INFINITY).should == Float::INFINITY
end
it "raises Math::DomainError given negative infinity" do
- lambda { Math.gamma(-infinity_value) }.should raise_error(Math::DomainError)
+ lambda { Math.gamma(-Float::INFINITY) }.should raise_error(Math::DomainError)
end
it "returns NaN given NaN" do

0 comments on commit b417d7b

Please sign in to comment.