Skip to content

Commit

Permalink
update regex
Browse files Browse the repository at this point in the history
Signed-off-by: Dheeraj Singh Dubey <dhsingh@progress.com>
  • Loading branch information
dheerajd-msys committed Feb 9, 2023
1 parent d25ce76 commit 7e7012b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def binary?(filepath)
# need to check for application/xml explicitly because only versions of
# libmagic < 5.26 are available on Ubuntu 14.04 and 16.04 which are our
# CI (Travis and Automate) node platforms
Utils::FileFormat.get_mime_type(file_path: filepath) !~ %r{^(text\/|inode\/x-empty|application\/xml)}
# s = File.read(filepath, 1024) || ""
# s.count("\0") == 0 ? false : true
Utils::FileFormat.get_mime_type(file_path: filepath) !~ %r{^text\/|inode\/x-empty|application\/xml|application\/json} # %r{^(text\/|inode\/x-empty|application\/xml)}
end

def too_big?(filepath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
it "returns an empty string" do
binary_files = artifact.binaries

expect(binary_files).to eq("apache2/metadata.json")
expect(binary_files).to eq("")
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
subject.perform(valid_params)

assert_requested(:post, test_evaluation_endpoint) do |req|
expect(req.body).to include("no_binaries_feedback=Failure")
expect(req.body).to include("no_binaries_failure=true")
expect(req.body).to include("no_binaries_feedback=passed")
expect(req.body).to include("no_binaries_failure=false")
end
end

Expand Down

0 comments on commit 7e7012b

Please sign in to comment.