mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-02 22:42:49 +08:00
16 lines
496 B
Ruby
16 lines
496 B
Ruby
describe "NSDate" do
|
|
it "#timeIntervalSinceReferenceDate should work" do
|
|
date = Time.at(-5000000000)
|
|
date.timeIntervalSinceReferenceDate.should == -5978307200
|
|
|
|
date = NSDate.alloc.initWithTimeIntervalSince1970(-5000000000)
|
|
date.timeIntervalSinceReferenceDate.should == -5978307200
|
|
end
|
|
|
|
it "#initWithTimeIntervalSinceReferenceDate: should work" do
|
|
date = NSDate.alloc.initWithTimeIntervalSinceReferenceDate(-5978307200)
|
|
date.should == Time.at(-5000000000)
|
|
end
|
|
end
|
|
|