Skip to content

Instantly share code, notes, and snippets.

@jnicklas
Created January 9, 2017 10:47
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 jnicklas/88b3f06ab395c904f48b736ecdd8c0ea to your computer and use it in GitHub Desktop.
Save jnicklas/88b3f06ab395c904f48b736ecdd8c0ea to your computer and use it in GitHub Desktop.
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
gem "rails", github: "rails/rails"
gem "arel", github: "rails/arel"
end
require "active_support"
require "active_support/core_ext/object/blank"
require "minitest/autorun"
class BugTest < Minitest::Test
def test_stuff
Time.stub(:now, Time.now) do
subclass = Class.new(Time)
assert_equal subclass, subclass.now.class
travel 1.day do
assert_equal subclass, subclass.now.class
assert_equal Time.now.to_s(:db), subclass.now.to_s(:db)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment