Skip to content

Instantly share code, notes, and snippets.

@aweis
Last active August 29, 2015 14:20
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 aweis/a5cd0a818ced48469d19 to your computer and use it in GitHub Desktop.
Save aweis/a5cd0a818ced48469d19 to your computer and use it in GitHub Desktop.
timestamps weirdness
#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