Skip to content

Commit

Permalink
Fix an rb_time_timespec_new spec
Browse files Browse the repository at this point in the history
For time zones with daylight saving time in effect, `Time.now` has a
DST offset, while the extension function returns a time object in
standard time offset.
  • Loading branch information
ahmadsherif committed Mar 14, 2016
1 parent 477db7c commit 2bf206d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/ruby/optional/capi/time_spec.rb
Expand Up @@ -274,7 +274,7 @@

it "returns time object in localtime if offset given equals INT_MAX" do
@s.rb_time_timespec_new(1447087832, 476451125, 0x7fffffff).should == Time.at(1447087832, 476451.125).localtime
@s.rb_time_timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff.should == Time.now.gmtoff
@s.rb_time_timespec_new(1447087832, 476451125, 0x7fffffff).gmtoff.should == Time.local(2016).gmtoff
end

it "raises an ArgumentError if offset passed is not within range of -86400 and 86400 (exclusive)" do
Expand Down

0 comments on commit 2bf206d

Please sign in to comment.