diff options
Diffstat (limited to 'gems/gitlab-secret_detection/spec/lib/gitlab/secret_detection/scan_spec.rb')
-rw-r--r-- | gems/gitlab-secret_detection/spec/lib/gitlab/secret_detection/scan_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gems/gitlab-secret_detection/spec/lib/gitlab/secret_detection/scan_spec.rb b/gems/gitlab-secret_detection/spec/lib/gitlab/secret_detection/scan_spec.rb index e69fcceeaab..c2377f57173 100644 --- a/gems/gitlab-secret_detection/spec/lib/gitlab/secret_detection/scan_spec.rb +++ b/gems/gitlab-secret_detection/spec/lib/gitlab/secret_detection/scan_spec.rb @@ -149,6 +149,16 @@ RSpec.describe Gitlab::SecretDetection::Scan, feature_category: :secret_detectio ) end + it "attempts to keyword match returning only filtered blobs for further scan" do + expected = blobs.filter { |b| b.data != "data with no secret" } + + expect(scan).to receive(:filter_by_keywords) + .with(blobs) + .and_return(expected) + + scan.secrets_scan(blobs) + end + it "matches multiple rules when running in main process" do expect(scan.secrets_scan(blobs, subprocess: false)).to eq(expected_response) end |