From 1243255c3a36433041012b6107a5ac48658a0895 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 30 Nov 2019 21:26:52 +0100 Subject: Update to ruby/spec@4eec3dc --- spec/ruby/core/time/new_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/ruby/core/time') 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 -- cgit v1.2.3