Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 18 lines (13 sloc) 0.645 kb
959e417 @weppos core_ext_test.rb => core_ext_spec.rb
authored
1 require "spec_helper"
2
3 describe DateTime do
4
5 describe "#to_time" do
6 it "should work" do
7 DateTime.new(2005, 2, 21, 10, 11, 12, 0, 0).to_time.should == Time.utc(2005, 2, 21, 10, 11, 12)
8
9 # NOTE: This test doesn't pass with Ruby 1.9, not because it doesn't work,
10 # but because Ruby 1.9 has a different implementation.
11 # ActiveRecord solves this by always removing the original Ruby method.
12 # DateTimes with offsets other than 0 are returned unaltered
13 # assert_equal DateTime.new(2005, 2, 21, 10, 11, 12, Rational(-5, 24)), DateTime.new(2005, 2, 21, 10, 11, 12, Rational(-5, 24)).to_time
14 end
15 end
16
17 end
Something went wrong with that request. Please try again.