Skip to content

Commit ef1a4ab

Browse files
committed
Restore ruby_version_is "3.2.3" do guards
1 parent d5f9250 commit ef1a4ab

File tree

3 files changed

+44
-36
lines changed

3 files changed

+44
-36
lines changed

spec/ruby/core/fiber/storage_spec.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,17 @@
8484
Fiber.new { Fiber[:life] }.resume.should be_nil
8585
end
8686

87-
it "can use dynamically defined keys" do
88-
key = :"#{self.class.name}#.#{self.object_id}"
89-
Fiber.new { Fiber[key] = 42; Fiber[key] }.resume.should == 42
90-
end
87+
ruby_version_is "3.2.3" do
88+
it "can use dynamically defined keys" do
89+
key = :"#{self.class.name}#.#{self.object_id}"
90+
Fiber.new { Fiber[key] = 42; Fiber[key] }.resume.should == 42
91+
end
9192

92-
it "can't use invalid keys" do
93-
invalid_keys = [Object.new, 12]
94-
invalid_keys.each do |key|
95-
-> { Fiber[key] }.should raise_error(TypeError)
93+
it "can't use invalid keys" do
94+
invalid_keys = [Object.new, 12]
95+
invalid_keys.each do |key|
96+
-> { Fiber[key] }.should raise_error(TypeError)
97+
end
9698
end
9799
end
98100

spec/ruby/core/string/to_f_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@
120120
"\3771.2".b.to_f.should == 0
121121
end
122122

123-
it "raises Encoding::CompatibilityError if String is in not ASCII-compatible encoding" do
124-
-> {
125-
'1.2'.encode("UTF-16").to_f
126-
}.should raise_error(Encoding::CompatibilityError, "ASCII incompatible encoding: UTF-16")
123+
ruby_version_is "3.2.3" do
124+
it "raises Encoding::CompatibilityError if String is in not ASCII-compatible encoding" do
125+
-> {
126+
'1.2'.encode("UTF-16").to_f
127+
}.should raise_error(Encoding::CompatibilityError, "ASCII incompatible encoding: UTF-16")
128+
end
127129
end
128130
end

spec/ruby/core/time/new_spec.rb

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -550,16 +550,18 @@ def obj.to_int; 3; end
550550
}.should raise_error(ArgumentError, /missing min part: 00 |can't parse:/)
551551
end
552552

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
558559

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
563565
end
564566

565567
it "raises ArgumentError if subsecond is missing after dot" do
@@ -698,22 +700,24 @@ def obj.to_int; 3; end
698700
}.should raise_error(ArgumentError, /can't parse.+ abc/)
699701
end
700702

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
709712

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
717721
end
718722
end
719723
end

0 commit comments

Comments
 (0)