From a133798633acfd95cf95de3c891b7a330de9409a Mon Sep 17 00:00:00 2001 From: ytjmt <46666464+ytjmt@users.noreply.github.com> Date: Sat, 15 Oct 2022 15:48:06 +0900 Subject: [PATCH] Add specs for Time#strftime supporting RFC 3339 UTC for unknown offset local time --- core/time/strftime_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/time/strftime_spec.rb b/core/time/strftime_spec.rb index 1bd24b0538..c133e22008 100644 --- a/core/time/strftime_spec.rb +++ b/core/time/strftime_spec.rb @@ -49,4 +49,13 @@ time = @new_time_with_offset[2012, 1, 1, 0, 0, 0, Rational(36645, 10)] time.strftime("%::z").should == "+01:01:05" end + + ruby_version_is "3.1" do + it "supports RFC 3339 UTC for unknown offset local time, -0000, as %-z" do + @time.strftime("%z").should == "+0000" + @time.strftime("%-z").should == "-0000" + @time.strftime("%-:z").should == "-00:00" + @time.strftime("%-::z").should == "-00:00:00" + end + end end