diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-03-16 23:29:06 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-03-16 23:29:06 +0900 |
commit | d4a53b465a6f77765e29f019d6ea4e6508c39f17 (patch) | |
tree | ecb2cd5452b6c582125e39f5085e0880b6b00df5 /spec/ruby/library | |
parent | 137b52a88192b0d44e218b0433aa0e16cfbeb091 (diff) |
Prefer the simple read/write `File` singleton methods
Diffstat (limited to 'spec/ruby/library')
-rw-r--r-- | spec/ruby/library/net-ftp/shared/puttextfile.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/library/net-ftp/shared/puttextfile.rb b/spec/ruby/library/net-ftp/shared/puttextfile.rb index 3836e954b8..4722439674 100644 --- a/spec/ruby/library/net-ftp/shared/puttextfile.rb +++ b/spec/ruby/library/net-ftp/shared/puttextfile.rb @@ -27,8 +27,8 @@ describe :net_ftp_puttextfile, shared: true do it "sends the contents of the passed local_file, using \\r\\n as the newline separator" do @ftp.send(@method, @local_fixture_file, "text") - remote_lines = open(@remote_tmp_file, "rb") {|f| f.read } - local_lines = open(@local_fixture_file, "rb") {|f| f.read } + remote_lines = File.binread(@remote_tmp_file) + local_lines = File.binread(@local_fixture_file) remote_lines.should_not == local_lines remote_lines.should == local_lines.gsub("\n", "\r\n") |