mirror of
https://github.com/securego/gosec.git
synced 2025-11-23 22:15:04 +02:00
Simplify tests by using GinkgoT().TempDir() (#1265)
This commit is contained in:
@@ -17,7 +17,6 @@ package gosec_test
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -45,10 +44,8 @@ var _ = Describe("Analyzer", func() {
|
||||
Context("when processing a package", func() {
|
||||
It("should not report an error if the package contains no Go files", func() {
|
||||
analyzer.LoadRules(rules.Generate(false).RulesInfo())
|
||||
dir, err := os.MkdirTemp("", "empty")
|
||||
defer os.RemoveAll(dir)
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
err = analyzer.Process(buildTags, dir)
|
||||
dir := GinkgoT().TempDir()
|
||||
err := analyzer.Process(buildTags, dir)
|
||||
Expect(err).ShouldNot(HaveOccurred())
|
||||
_, _, errors := analyzer.Report()
|
||||
Expect(errors).To(BeEmpty())
|
||||
|
||||
Reference in New Issue
Block a user