mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-23 12:27:56 +08:00
14 lines
401 B
Ruby
14 lines
401 B
Ruby
# require File.expand_path('../../../spec_helper', __FILE__)
|
|
|
|
describe "Time#to_r" do
|
|
ruby_version_is "1.9" do
|
|
it "returns the a Rational representing seconds and subseconds since the epoch" do
|
|
Time.at(Rational(11, 10)).to_r.should == Rational(11, 10)
|
|
end
|
|
|
|
it "returns a Rational even for a whole number of seconds" do
|
|
Time.at(2).to_r.should == Rational(2)
|
|
end
|
|
end
|
|
end
|