Skip to content

Commit 5f9867c

Browse files
herwinweregon
authored andcommitted
Add extra test for IO.new with internal_encoding keyword
When providing a single encoding in the mode argument, the external encoding of the IO object is set to that encoding, the internal encoding is left blank. The ArgumentError in this case is a rather specific behaviour.
1 parent b2c8ead commit 5f9867c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

core/io/shared/new.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@
324324
-> {
325325
@io = IO.send(@method, @fd, 'w:ISO-8859-1', external_encoding: 'ISO-8859-1')
326326
}.should raise_error(ArgumentError)
327+
-> {
328+
@io = IO.send(@method, @fd, 'w:ISO-8859-1', internal_encoding: 'ISO-8859-1')
329+
}.should raise_error(ArgumentError)
327330
-> {
328331
@io = IO.send(@method, @fd, 'w:ISO-8859-1:UTF-8', internal_encoding: 'ISO-8859-1')
329332
}.should raise_error(ArgumentError)

0 commit comments

Comments
 (0)