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 f0fed97 commit 567ecbaCopy full SHA for 567ecba
spec/octocatalog-diff/tests/spec_helper.rb
@@ -39,20 +39,19 @@ class CustomLogger
39
40
def initialize
41
@tf = Tempfile.new('customlogger.log')
42
- at_exit do
43
- @tf.close
44
- @tf.unlink
45
- end
+ @tf.close
+ at_exit { @tf.unlink }
46
47
- @logger = Logger.new @tf
+ @logger = Logger.new @tf.path
48
@logger.level = Logger::DEBUG
49
end
50
51
def string
52
@content ||= begin
53
54
- content = File.read(@tf.path)
55
- content.sub(/\A# Logfile created .+\n/, '')
+ if File.file?(@tf.path)
+ content = File.read(@tf.path)
+ content.sub(/\A# Logfile created .+\n/, '')
+ end
56
57
58
0 commit comments