Permalink
Browse files

Merge pull request #818 from sideshowcoder/fix-time-usec

Fix Time#usec to actually pass the specs
  • Loading branch information...
alex committed Aug 13, 2013
2 parents 2e58963 + 7d498c9 commit 42c875e1b48906418488eaa6d9d1a9b20534592d
Showing with 1 addition and 5 deletions.
  1. +1 −2 lib-topaz/time.rb
  2. +0 −3 spec/tags/core/time/usec_tags.txt
@@ -1,7 +1,6 @@
class Time
def usec
float = self.to_f
(float - float.floor) * 1e6
(self.to_f * 1e6 % 1e6).floor
end

def tv_usec
@@ -1,6 +1,3 @@
fails:Time#usec returns the microseconds part of a Time constructed with an Integer number of microseconds
fails:Time#usec returns the microseconds part of a Time constructed with an Float number of microseconds > 1
fails:Time#usec returns 0 for a Time constructed with an Float number of microseconds < 1
fails:Time#usec returns the microseconds part of a Time constructed with a Rational number of seconds
fails:Time#usec returns the microseconds part of a Time constructed with an Rational number of microseconds > 1
fails:Time#usec returns 0 for a Time constructed with an Rational number of microseconds < 1

0 comments on commit 42c875e

Please sign in to comment.