Skip to content

Commit 421ffd1

Browse files
headiusandrykonchin
authored andcommitted
Guard on StringIO::VERSION, not RUBY_VERSION
StringIO version checks should be independent of the Ruby version since it may float on both CRuby and alternative Ruby impls.
1 parent 2d690c3 commit 421ffd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/stringio/shared/read.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
buffer.should == "example"
1616
end
1717

18-
ruby_version_is ""..."3.4" do
18+
guard -> { StringIO::VERSION < "3.1.1" } do
1919
it "does not preserve the encoding of the given buffer" do
2020
buffer = ''.encode(Encoding::ISO_8859_1)
2121
@io.send(@method, 7, buffer)
@@ -24,7 +24,7 @@
2424
end
2525
end
2626

27-
ruby_version_is "3.4" do
27+
guard -> { StringIO::VERSION >= "3.1.1" } do
2828
it "preserves the encoding of the given buffer" do
2929
buffer = ''.encode(Encoding::ISO_8859_1)
3030
@io.send(@method, 7, buffer)

0 commit comments

Comments
 (0)