summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time/shared/time_params.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/time/shared/time_params.rb')
-rw-r--r--spec/ruby/core/time/shared/time_params.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/time/shared/time_params.rb b/spec/ruby/core/time/shared/time_params.rb
index 120d8d3af1..39245116b0 100644
--- a/spec/ruby/core/time/shared/time_params.rb
+++ b/spec/ruby/core/time/shared/time_params.rb
@@ -230,6 +230,10 @@ describe :time_params_microseconds, shared: true do
t.usec.should == 123
end
+ it "raises an ArgumentError for out of range microsecond" do
+ lambda { Time.send(@method, 2000, 1, 1, 20, 15, 1, 1000000) }.should raise_error(ArgumentError)
+ end
+
it "handles fractional microseconds as a Float" do
t = Time.send(@method, 2000, 1, 1, 20, 15, 1, 1.75)
t.usec.should == 1