'Minitest: Testing for Infinity
I am trying to create a Minitest test that tests for an instance of Infinity being returned in an array. However I am getting an uninitialized constant error. How do I check for Infinity in an array?
This is the test:
def test_lgamma
x = 0
z = Math.lgamma(x)
puts z
assert_equal [Infinity, 1], z
end
This is the error:
NameError: uninitialized constant Tests::Infinity
.../CORE_MATH.rb:131:in `test_lgamma'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
