Sha256: c59b40bdf606d6aa08c2000b3144dd089cfeb6a906d96285d62c3a0109e1b822
Contents?: true
Size: 1.2 KB
Versions: 83
Compression:
Stored size: 1.2 KB
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/methods' describe "Time.at" do ruby_version_is ""..."1.9" do it "converts to time object" do # the #chomp calls are necessary because of RSpec Time.at(1168475924).inspect.chomp.should == localtime_18(1168475924).chomp end end ruby_version_is "1.9" do it "converts to time object" do # the #chomp calls are necessary because of RSpec Time.at(1168475924).inspect.chomp.should == localtime_19(1168475924).chomp end end it "creates a new time object with the value given by time" do t = Time.now Time.at(t).inspect.should == t.inspect end it "creates a dup time object with the value given by time" do t1 = Time.new t2 = Time.at(t1) t1.object_id.should_not == t2.object_id end it "is able to create a time object with a float" do t = Time.at(10.5) t.usec.should == 500000.0 t.should_not == Time.at(10) end it "is able to create a time object with a microseconds" do t = Time.at(10, 500000) t.usec.should == 500000.0 t.should_not == Time.at(10) end end
Version data entries
83 entries across 83 versions & 1 rubygems