Skip to content
Browse files

Make #succ work

  • Loading branch information...
1 parent 366acdb commit 2da470711765114b1421d9d02864542a40e1de8e @alloy committed May 3, 2010
View
11 mrtime.rb
@@ -212,6 +212,17 @@ def to_i
timeIntervalSince1970.round
end
+ # call-seq:
+ # time.succ => new_time
+ #
+ # Return a new time object, one second later than <code>time</code>.
+ #
+ # t = Time.now #=> 2007-11-19 08:23:57 -0600
+ # t.succ #=> 2007-11-19 08:23:58 -0600
+ def succ
+ self.class.dateWithTimeIntervalSinceReferenceDate(timeIntervalSinceReferenceDate + 1)
+ end
+
##
#
# Specific day sugar
View
0 spec/time/todo/mday_spec.rb → spec/time/mday_spec.rb
File renamed without changes.
View
6 spec/time/todo/hash_spec.rb
@@ -1,12 +1,12 @@
-require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../../spec_helper', __FILE__)
require File.expand_path('../fixtures/methods', __FILE__)
describe "MRTime#hash" do
it "returns a Fixnum" do
- MRTime.at(100).hash.should be_kind_of(Fixnum)
+ MRTime.at(100).hash.should.be.instance_of(Fixnum)
end
it "is stable" do
MRTime.at(1234).hash.should == MRTime.at(1234).hash
- end
+ end
end
View
14 spec/time/todo/succ_spec.rb
@@ -1,14 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/methods', __FILE__)
-
-describe "MRTime#succ" do
- it "returns a new time one second later than time" do
- MRTime.at(100).succ.should == MRTime.at(101)
- end
-
- it "returns a new instance" do
- t1 = MRTime.at(100)
- t2 = t1.succ
- t1.object_id.should_not == t2.object_id
- end
-end
View
0 spec/time/todo/dst_spec.rb → spec/time/todo/timezone_related/dst_spec.rb
File renamed without changes.
View
0 spec/time/todo/getgm_spec.rb → .../time/todo/timezone_related/getgm_spec.rb
File renamed without changes.
View
0 spec/time/todo/getlocal_spec.rb → ...me/todo/timezone_related/getlocal_spec.rb
File renamed without changes.
View
0 spec/time/todo/getutc_spec.rb → ...time/todo/timezone_related/getutc_spec.rb
File renamed without changes.
View
0 spec/time/todo/gm_spec.rb → spec/time/todo/timezone_related/gm_spec.rb
File renamed without changes.
View
0 spec/time/todo/gmt_offset_spec.rb → .../todo/timezone_related/gmt_offset_spec.rb
File renamed without changes.
View
0 spec/time/todo/gmt_spec.rb → spec/time/todo/timezone_related/gmt_spec.rb
File renamed without changes.
View
0 spec/time/todo/gmtime_spec.rb → ...time/todo/timezone_related/gmtime_spec.rb
File renamed without changes.
View
0 spec/time/todo/gmtoff_spec.rb → ...time/todo/timezone_related/gmtoff_spec.rb
File renamed without changes.
View
0 spec/time/todo/isdst_spec.rb → .../time/todo/timezone_related/isdst_spec.rb
File renamed without changes.
View
0 spec/time/todo/local_spec.rb → .../time/todo/timezone_related/local_spec.rb
File renamed without changes.
View
0 spec/time/todo/localtime_spec.rb → ...e/todo/timezone_related/localtime_spec.rb
File renamed without changes.
View
0 spec/time/todo/utc_offset_spec.rb → .../todo/timezone_related/utc_offset_spec.rb
File renamed without changes.
View
0 spec/time/todo/utc_spec.rb → spec/time/todo/timezone_related/utc_spec.rb
File renamed without changes.
View
0 spec/time/todo/zone_spec.rb → spec/time/todo/timezone_related/zone_spec.rb
File renamed without changes.

0 comments on commit 2da4707

Please sign in to comment.
Something went wrong with that request. Please try again.