require "stringio"
io = StringIO.new("hello".freeze)
io << "world"
# 💣 IOError: not opened for writing
io2 = StringIO.new("hello".freeze, "w+")
# 💣 Errno::EACCES: Permission denied
io3 = StringIO.new("hello".freeze, File::RDWR)
# 💣 Errno::EACCES: Permission denied