1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/time/succ_spec.rb
eregon 75334db3c6 Update to ruby/spec@6cf8ebe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-07 16:35:33 +00:00

39 lines
817 B
Ruby

require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "Time#succ" do
it "returns a new time one second later than time" do
suppress_warning {
@result = Time.at(100).succ
}
@result.should == Time.at(101)
end
it "returns a new instance" do
time = Time.at(100)
suppress_warning {
@result = time.succ
}
@result.should_not equal time
end
it "is obsolete" do
lambda {
Time.at(100).succ
}.should complain(/Time#succ is obsolete/)
end
ruby_version_is "2.6" do
context "zone is a timezone object" do
it "preserves time zone" do
zone = TimeSpecs::Timezone.new(offset: (5*3600+30*60))
time = Time.new(2012, 1, 1, 12, 0, 0, zone) - 60*60
time.zone.should == zone
end
end
end
end