Skip to content
Permalink
Browse files

Merge pull request #540 from jstepien/integer-times

Integer#times passes all specs
  • Loading branch information
alex committed Mar 21, 2013
2 parents e6071fa + 388e35c commit f118a8453b24d4862d394f902e4abf416b9e062f
Showing with 9 additions and 11 deletions.
  1. +0 −8 lib-topaz/fixnum.rb
  2. +9 −0 lib-topaz/integer.rb
  3. +0 −3 spec/tags/core/integer/times_tags.txt
@@ -7,14 +7,6 @@ def succ
self + 1
end

def times
i = 0
while i < self
yield i
i += 1
end
end

def upto(n)
i = self
while i <= n
@@ -7,4 +7,13 @@ def downto(limit, &block)
current -= 1
end
end

def times
i = 0
while i < self
yield i
i += 1
end
self
end
end
@@ -1,4 +1 @@
fails:Integer#times returns self
fails:Integer#times executes a nested while loop containing a break expression
fails:Integer#times executes a nested #times
fails:Integer#times returns an Enumerator

0 comments on commit f118a84

Please sign in to comment.