@@ -550,16 +550,18 @@ def obj.to_int; 3; end
550
550
}.should raise_error(ArgumentError, /missing min part: 00 |can't parse:/)
551
551
end
552
552
553
- it "raises ArgumentError if the time part is missing" do
554
- -> {
555
- Time.new("2020-12-25")
556
- }.should raise_error(ArgumentError, /no time information|can't parse:/)
557
- end
553
+ ruby_version_is "3.2.3" do
554
+ it "raises ArgumentError if the time part is missing" do
555
+ -> {
556
+ Time.new("2020-12-25")
557
+ }.should raise_error(ArgumentError, /no time information|can't parse:/)
558
+ end
558
559
559
- it "raises ArgumentError if day is missing" do
560
- -> {
561
- Time.new("2020-12")
562
- }.should raise_error(ArgumentError, /no time information|can't parse:/)
560
+ it "raises ArgumentError if day is missing" do
561
+ -> {
562
+ Time.new("2020-12")
563
+ }.should raise_error(ArgumentError, /no time information|can't parse:/)
564
+ end
563
565
end
564
566
565
567
it "raises ArgumentError if subsecond is missing after dot" do
@@ -698,22 +700,24 @@ def obj.to_int; 3; end
698
700
}.should raise_error(ArgumentError, /can't parse.+ abc/)
699
701
end
700
702
701
- it "raises ArgumentError when there are leading space characters" do
702
- -> { Time.new(" 2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
703
- -> { Time.new("\t2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
704
- -> { Time.new("\n2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
705
- -> { Time.new("\v2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
706
- -> { Time.new("\f2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
707
- -> { Time.new("\r2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
708
- end
703
+ ruby_version_is "3.2.3" do
704
+ it "raises ArgumentError when there are leading space characters" do
705
+ -> { Time.new(" 2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
706
+ -> { Time.new("\t2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
707
+ -> { Time.new("\n2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
708
+ -> { Time.new("\v2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
709
+ -> { Time.new("\f2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
710
+ -> { Time.new("\r2020-12-02 00:00:00") }.should raise_error(ArgumentError, /can't parse/)
711
+ end
709
712
710
- it "raises ArgumentError when there are trailing whitespaces" do
711
- -> { Time.new("2020-12-02 00:00:00 ") }.should raise_error(ArgumentError, /can't parse/)
712
- -> { Time.new("2020-12-02 00:00:00\t") }.should raise_error(ArgumentError, /can't parse/)
713
- -> { Time.new("2020-12-02 00:00:00\n") }.should raise_error(ArgumentError, /can't parse/)
714
- -> { Time.new("2020-12-02 00:00:00\v") }.should raise_error(ArgumentError, /can't parse/)
715
- -> { Time.new("2020-12-02 00:00:00\f") }.should raise_error(ArgumentError, /can't parse/)
716
- -> { Time.new("2020-12-02 00:00:00\r") }.should raise_error(ArgumentError, /can't parse/)
713
+ it "raises ArgumentError when there are trailing whitespaces" do
714
+ -> { Time.new("2020-12-02 00:00:00 ") }.should raise_error(ArgumentError, /can't parse/)
715
+ -> { Time.new("2020-12-02 00:00:00\t") }.should raise_error(ArgumentError, /can't parse/)
716
+ -> { Time.new("2020-12-02 00:00:00\n") }.should raise_error(ArgumentError, /can't parse/)
717
+ -> { Time.new("2020-12-02 00:00:00\v") }.should raise_error(ArgumentError, /can't parse/)
718
+ -> { Time.new("2020-12-02 00:00:00\f") }.should raise_error(ArgumentError, /can't parse/)
719
+ -> { Time.new("2020-12-02 00:00:00\r") }.should raise_error(ArgumentError, /can't parse/)
720
+ end
717
721
end
718
722
end
719
723
end
0 commit comments