We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b826066 commit 8b677adCopy full SHA for 8b677ad
spec/ruby/core/io/shared/write.rb
@@ -69,6 +69,16 @@
69
lambda { IOSpecs.closed_io.send(@method, "hello") }.should raise_error(IOError)
70
end
71
72
+ it "does not modify the passed argument" do
73
+ File.open(@filename, "w") do |f|
74
+ f.set_encoding(Encoding::IBM437)
75
+ # A character whose codepoint differs between UTF-8 and IBM437
76
+ f.write "ƒ\n".freeze
77
+ end
78
+
79
+ File.binread(@filename).bytes.should == [159, 10]
80
81
82
describe "on a pipe" do
83
before :each do
84
@r, @w = IO.pipe
0 commit comments