test for IO.open as a way of creating an IO instance

This commit is contained in:
Alex Ford
2021-09-22 16:28:17 +01:00
parent 0092c0279b
commit b769aa67c2
2 changed files with 5 additions and 0 deletions

View File

@@ -34,6 +34,8 @@ ioInstances
| Files.rb:23:19:23:33 | call to open |
| Files.rb:24:1:24:40 | ... = ... |
| Files.rb:24:19:24:40 | call to open |
| Files.rb:35:1:35:56 | ... = ... |
| Files.rb:35:13:35:56 | call to open |
fileReaders
| Files.rb:7:13:7:32 | call to readlines |
ioReaders

View File

@@ -30,3 +30,6 @@ foo_text = IO.read("foo.txt")
# `IO.read("|date")` does not read from a file
date = IO.read("|date")
# `rand_open` is an `IO` instance
rand_open = IO.open(IO.sysopen("/dev/random", "r"), "r")