Skip to content

Commit

Permalink
#250: accuracy log files should support *.txt extension
Browse files Browse the repository at this point in the history
Fixed #250
  • Loading branch information
dgroup committed Nov 13, 2020
1 parent cc846ac commit c0fa224
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/lazylead/task/accuracy/logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def initialize
# Ensure that ticket has a '*.log' file more '10KB'
def matching(attachment)
attachment.attrs["size"].to_i > 10_240 &&
File.extname(attachment.attrs["filename"]).downcase.start_with?(".log")
File.extname(attachment.attrs["filename"])
.downcase
.start_with?(".log", ".txt")
end
end
end
24 changes: 24 additions & 0 deletions test/lazylead/task/accuracy/logs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,29 @@ class LogsTest < Lazylead::Test
)
)
end

test "rotated log file is present" do
assert Logs.new.passed(
OpenStruct.new(
attachments: [
OpenStruct.new(
attrs: { "size" => 10_241, "filename" => "catalina.log111" }
)
]
)
)
end

test "log txt file is present" do
assert Logs.new.passed(
OpenStruct.new(
attachments: [
OpenStruct.new(
attrs: { "size" => 10_241, "filename" => "catalina.txt" }
)
]
)
)
end
end
end

0 comments on commit c0fa224

Please sign in to comment.