infinity 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/infinity.gemspec +1 -1
- data/lib/infinity.rb +5 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/infinity.gemspec
CHANGED
data/lib/infinity.rb
CHANGED
@@ -7,6 +7,8 @@ class Infinity
|
|
7
7
|
self
|
8
8
|
end
|
9
9
|
def /(obj)
|
10
|
+
return 1 if obj == Infinity
|
11
|
+
return 1 if obj.kind_of? Infinity
|
10
12
|
self
|
11
13
|
end
|
12
14
|
def *(obj)
|
@@ -41,6 +43,9 @@ class TC_Infinity < Test::Unit::TestCase
|
|
41
43
|
assert_equal(Infinity, (Infinity - 23))
|
42
44
|
assert_equal(Infinity, (Infinity / 23))
|
43
45
|
assert_equal(Infinity, (Infinity * 23))
|
46
|
+
assert_equal(1, (Infinity / Infinity))
|
47
|
+
assert_equal(1, (Infinity.new / Infinity))
|
48
|
+
assert_equal(1, (Infinity.new / Infinity.new))
|
44
49
|
end
|
45
50
|
|
46
51
|
def test_comparable
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infinity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Bretoi
|