Sha256: 513786e3bdd91f67e3199d8b1893f3df37bf5abfd3e6b261b30fb9979359ea6b

Contents?: true

Size: 645 Bytes

Versions: 18

Compression:

Stored size: 645 Bytes

Contents

require "spec_helper"

describe DateTime do

  describe "#to_time" do
    it "should work" do
      DateTime.new(2005, 2, 21, 10, 11, 12, 0, 0).to_time.should == Time.utc(2005, 2, 21, 10, 11, 12)

      # NOTE: This test doesn't pass with Ruby 1.9, not because it doesn't work,
      # but because Ruby 1.9 has a different implementation.
      # ActiveRecord solves this by always removing the original Ruby method.
      # DateTimes with offsets other than 0 are returned unaltered
      # 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
    end
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
whois-2.6.3 spec/whois/core_ext_spec.rb
whois-2.6.2 spec/whois/core_ext_spec.rb
whois-2.6.1 spec/whois/core_ext_spec.rb
whois-2.6.0 spec/whois/core_ext_spec.rb
whois-2.5.1 spec/whois/core_ext_spec.rb
whois-2.5.0 spec/whois/core_ext_spec.rb
whois-2.4.0 spec/whois/core_ext_spec.rb
whois-2.3.0 spec/whois/core_ext_spec.rb
whois-2.2.0 spec/whois/core_ext_spec.rb
whois-2.1.0 spec/whois/core_ext_spec.rb
whois-2.0.7 spec/whois/core_ext_spec.rb
whois-2.0.6 spec/whois/core_ext_spec.rb
whois-2.0.5 spec/whois/core_ext_spec.rb
whois-2.0.4 spec/whois/core_ext_spec.rb
whois-2.0.3 spec/whois/core_ext_spec.rb
whois-2.0.2 spec/whois/core_ext_spec.rb
whois-2.0.1 spec/whois/core_ext_spec.rb
whois-2.0.0 spec/whois/core_ext_spec.rb