Last active
August 29, 2015 14:20
-
-
Save aweis/a5cd0a818ced48469d19 to your computer and use it in GitHub Desktop.
timestamps weirdness
This file contains 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
#s/ActiveSupport::TestCase/Test::Unit::TestCase works | |
require 'test_helper' | |
class ThingTest < ActiveSupport::TestCase | |
def test_thing | |
ActiveRecord::Base.uncached do | |
first = ActiveRecord::Base.connection.query("select now();") | |
p [Time.now, first] | |
sleep 3 | |
second = ActiveRecord::Base.connection.query("select now();") | |
p [Time.now, second] | |
end | |
end | |
end | |
Output | |
Started | |
[2015-05-04 22:41:38 -0700, [["2015-05-05 05:41:38.080101+00"]]] | |
[2015-05-04 22:41:41 -0700, [["2015-05-05 05:41:38.080101+00"]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment