From 6b3bd46fa89d1b6bf46bb41b561887c7841127d3 Mon Sep 17 00:00:00 2001 From: Adam Kobi Date: Sun, 13 Jan 2019 13:55:01 +0200 Subject: [PATCH] added tests for scanning single branch and non-existing branch --- gitleaks_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gitleaks_test.go b/gitleaks_test.go index d9088dea..2de13b2b 100644 --- a/gitleaks_test.go +++ b/gitleaks_test.go @@ -320,6 +320,23 @@ func TestRun(t *testing.T) { expectedErrMsg: "", commitPerPage: 1, }, + { + testOpts: Options{ + Repo: "https://github.com/gitleakstest/gronit.git", + Branch: "master", + }, + description: "test github leaks on single branch - master", + numLeaks: 2, + }, + { + testOpts: Options{ + Repo: "https://github.com/gitleakstest/gronit.git", + Branch: "nonExistingBranch", + }, + description: "test github leaks on single branch which doesn't exist", + numLeaks: 0, + expectedErrMsg: "reference not found", + }, } g := goblin.Goblin(t) for _, test := range tests {