Created
June 26, 2011 05:06
-
-
Save tjmcewan/1047266 to your computer and use it in GitHub Desktop.
rspec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(rdb:1) date | |
2010-09-26 05:02:10 UTC | |
(rdb:1) date.class | |
Time | |
(rdb:1) @league.rounds.current.start_date.utc | |
2010-09-26 05:02:10 UTC | |
(rdb:1) @league.rounds.current.start_date.utc.class | |
Time | |
(rdb:1) @league.rounds.current.start_date.utc == date | |
false | |
#AND THE SOLUTION IS: | |
(rdb:1) @league.rounds.current.start_date.utc.should be_within(1).of(date) | |
true | |
# Cheers to @ryanbigg, @vowel_boy, @ivanvanderbyl, & @pda :-D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like
Time
has a#usec
method, but the microseconds being stored aren't shown in#to_s
. As a workaround you could try:or just