We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 567ecba commit f7ce7afCopy full SHA for f7ce7af
1 file changed
spec/octocatalog-diff/tests/spec_helper.rb
@@ -47,11 +47,12 @@ def initialize
47
end
48
49
def string
50
+ # Written as an exception handler, rather than File.file?, because in some tests File.file? is mocked.
51
@content ||= begin
- if File.file?(@tf.path)
52
- content = File.read(@tf.path)
53
- content.sub(/\A# Logfile created .+\n/, '')
54
- end
+ content = File.read(@tf.path)
+ content.sub(/\A# Logfile created .+\n/, '')
+ rescue Errno::ENOENT
55
+ ''
56
57
58
0 commit comments