diff options
author | Benoit Daloze <[email protected]> | 2019-11-30 21:26:52 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-11-30 21:26:52 +0100 |
commit | 1243255c3a36433041012b6107a5ac48658a0895 (patch) | |
tree | 04440f84b48999ff08d4a2a16d066d0ad731400e /spec/ruby/core/time | |
parent | ab8345271eb87ff155d8bd5f22f53a4cf2902c26 (diff) |
Update to ruby/spec@4eec3dc
Diffstat (limited to 'spec/ruby/core/time')
-rw-r--r-- | spec/ruby/core/time/new_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/time/new_spec.rb b/spec/ruby/core/time/new_spec.rb index dcdd83a085..01ee47faa1 100644 --- a/spec/ruby/core/time/new_spec.rb +++ b/spec/ruby/core/time/new_spec.rb @@ -113,6 +113,12 @@ describe "Time.new with a utc_offset argument" do it "raises ArgumentError if the utc_offset argument is greater than or equal to 10e9" do -> { Time.new(2000, 1, 1, 0, 0, 0, 1000000000) }.should raise_error(ArgumentError) end + + it "raises ArgumentError if the month is greater than 12" do + # For some reason MRI uses a different message for month in 13-15 and month>=16 + -> { Time.new(2000, 13, 1, 0, 0, 0, "+01:00") }.should raise_error(ArgumentError, /(mon|argument) out of range/) + -> { Time.new(2000, 16, 1, 0, 0, 0, "+01:00") }.should raise_error(ArgumentError, "argument out of range") + end end ruby_version_is "2.6" do |