Skip to content

Commit

Permalink
Prefer the simple read/write File singleton methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Mar 16, 2024
1 parent 137b52a commit d4a53b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/ruby/library/net-ftp/shared/puttextfile.rb
Expand Up @@ -27,8 +27,8 @@
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")
Expand Down
4 changes: 2 additions & 2 deletions test/ruby/test_dir_m17n.rb
Expand Up @@ -318,7 +318,7 @@ def with_enc_path

def test_glob_warning_opendir
with_enc_path do |dir|
open("#{dir}/x", "w") {}
File.binwrite("#{dir}/x", "")
File.chmod(0300, dir)
next if File.readable?(dir)
assert_warning(/#{dir}/) do
Expand All @@ -329,7 +329,7 @@ def test_glob_warning_opendir

def test_glob_warning_match_all
with_enc_path do |dir|
open("#{dir}/x", "w") {}
File.binwrite("#{dir}/x", "")
File.chmod(0000, dir)
next if File.readable?(dir)
assert_warning(/#{dir}/) do
Expand Down

0 comments on commit d4a53b4

Please sign in to comment.