Skip to content

Commit 2bbf363

Browse files
authored
Merge pull request #190 from rubycdp/support/fix-linter-offenses
2 parents 5ddd5aa + c3be94d commit 2bbf363

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

spec/features/driver_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def create_screenshot(file, *args)
324324

325325
def create_screenshot(file, *args)
326326
image = @driver.render_base64(format, *args)
327-
File.open(file, "wb") { |f| f.write Base64.decode64(image) }
327+
File.binwrite(file, Base64.decode64(image))
328328
end
329329

330330
it "supports rendering the page in base64" do

spec/features/session_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231

232232
it "attaches a file when passed a Pathname" do
233233
filename = Pathname.new("spec/tmp/a_test_pathname").expand_path
234-
File.open(filename, "w") { |f| f.write("text") }
234+
File.write(filename, "text")
235235

236236
element = @session.find(:css, "#change_me_file")
237237
element.set(filename)

spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def save_exception_screenshot(browser, filename, line_number, timestamp)
120120

121121
def save_exception_log(browser, filename, line_number, timestamp)
122122
log_name = "logfile-#{filename}-#{line_number}-#{timestamp}.txt"
123-
File.open("/tmp/cuprite/#{log_name}", "wb") { |f| f.write(browser.logger.string) }
123+
File.binwrite("/tmp/cuprite/#{log_name}", browser.logger.string)
124124
rescue StandardError => e
125125
puts "#{e.class}: #{e.message}"
126126
end

0 commit comments

Comments
 (0)