summaryrefslogtreecommitdiff
path: root/spec/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2026-01-29 12:18:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2026-01-29 17:08:42 +0900
commit62493b572d2b6a6984cbbdc32db942dbf894d056 (patch)
tree4936892f8d280ed20daa3170c771f11ec2117cb4 /spec/ruby
parentcd26647f537e6c3d1ab3fe5675df47fdbddf8d48 (diff)
Fix assertions not to be affected by the default encoding
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/io/buffer/map_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/io/buffer/map_spec.rb b/spec/ruby/core/io/buffer/map_spec.rb
index d980eb0ae0..80ee65125e 100644
--- a/spec/ruby/core/io/buffer/map_spec.rb
+++ b/spec/ruby/core/io/buffer/map_spec.rb
@@ -12,11 +12,11 @@ describe "IO::Buffer.map" do
end
def open_fixture
- File.open("#{__dir__}/../fixtures/read_text.txt", "r+")
+ File.open("#{__dir__}/../fixtures/read_text.txt", "rb+")
end
def open_big_file_fixture
- File.open(@big_file_name, "r+")
+ File.open(@big_file_name, "rb+")
end
after :each do
@@ -308,11 +308,11 @@ describe "IO::Buffer.map" do
@buffer.set_string("test12345")
@buffer.get_string.should == "test12345".b
- @file.read.should == "abcâdef\n"
+ @file.read.should == "abcâdef\n".b
end
it "allows mapping read-only files and modifying the buffer" do
- @file = File.open("#{__dir__}/../fixtures/read_text.txt", "r")
+ @file = File.open("#{__dir__}/../fixtures/read_text.txt", "rb")
@buffer = IO::Buffer.map(@file, nil, 0, IO::Buffer::PRIVATE)
@buffer.should.private?
@@ -323,7 +323,7 @@ describe "IO::Buffer.map" do
@buffer.set_string("test12345")
@buffer.get_string.should == "test12345".b
- @file.read.should == "abcâdef\n"
+ @file.read.should == "abcâdef\n".b
end
platform_is_not :windows do