summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time/nsec_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/time/nsec_spec.rb')
-rw-r--r--spec/ruby/core/time/nsec_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/ruby/core/time/nsec_spec.rb b/spec/ruby/core/time/nsec_spec.rb
index 3a6be1d016..9338eb435a 100644
--- a/spec/ruby/core/time/nsec_spec.rb
+++ b/spec/ruby/core/time/nsec_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path('../../../spec_helper', __FILE__)
+require_relative '../../spec_helper'
describe "Time#nsec" do
it "returns 0 for a Time constructed with a whole number of seconds" do
@@ -24,4 +24,8 @@ describe "Time#nsec" do
it "returns the nanoseconds part of a Time constructed with an Rational number of microseconds" do
Time.at(0, Rational(99, 10)).nsec.should == 9900
end
+
+ it "returns a positive value for dates before the epoch" do
+ Time.utc(1969, 11, 12, 13, 18, 57, 404240).nsec.should == 404240000
+ end
end