Skip to content

Commit 4c0f1b3

Browse files
committed
Fix recently added spec for String#to_f on Ruby 3.2
1 parent 97876e7 commit 4c0f1b3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/ruby/core/string/to_f_spec.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@
120120
"\3771.2".b.to_f.should == 0
121121
end
122122

123-
ruby_version_is "3.2" do
123+
ruby_version_is ""..."3.3" do
124+
it "does not raise any exception if String is in not ASCII-compatible encoding" do
125+
'1.2'.encode("UTF-16").to_f.should == 0.0
126+
end
127+
end
128+
129+
ruby_version_is "3.3" do
124130
it "raises Encoding::CompatibilityError if String is in not ASCII-compatible encoding" do
125131
-> {
126132
'1.2'.encode("UTF-16").to_f

0 commit comments

Comments
 (0)