Skip to content

Instantly share code, notes, and snippets.

@simi
Last active December 27, 2015 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simi/7343708 to your computer and use it in GitHub Desktop.
Save simi/7343708 to your computer and use it in GitHub Desktop.
# with loaded Active Support
def test_equal_date_time_and_time_to_f_conversion
dt = DateTime.parse("2012-06-17 18:42:15.123Z")
t = Time.parse("2012-06-17 18:42:15.123Z")
assert_equal t.to_f, dt.to_f
end
# 1) Failure:
# MyTestTest#test_equal_date_time_and_time_to_f_conversion
# Expected: 1339958535.1230001
# Actual: 1339958535.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment