Skip to content

Commit b769aa6

Browse files
committed
test for IO.open as a way of creating an IO instance
1 parent 0092c02 commit b769aa6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ql/test/library-tests/frameworks/Files.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ ioInstances
3434
| Files.rb:23:19:23:33 | call to open |
3535
| Files.rb:24:1:24:40 | ... = ... |
3636
| Files.rb:24:19:24:40 | call to open |
37+
| Files.rb:35:1:35:56 | ... = ... |
38+
| Files.rb:35:13:35:56 | call to open |
3739
fileReaders
3840
| Files.rb:7:13:7:32 | call to readlines |
3941
ioReaders

ql/test/library-tests/frameworks/Files.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@
3030

3131
# `IO.read("|date")` does not read from a file
3232
date = IO.read("|date")
33+
34+
# `rand_open` is an `IO` instance
35+
rand_open = IO.open(IO.sysopen("/dev/random", "r"), "r")

0 commit comments

Comments
 (0)