mirror of
https://github.com/anchore/syft.git
synced 2026-11-06 09:24:19 +01:00
* normalize cataloger patterns Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * remove central reference for maven configurable Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
59 lines
1.1 KiB
Go
59 lines
1.1 KiB
Go
package ruby
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
|
|
)
|
|
|
|
func Test_GemFileLock_Globs(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
fixture string
|
|
expected []string
|
|
}{
|
|
{
|
|
name: "obtain gemfile lock files",
|
|
fixture: "test-fixtures/glob-paths",
|
|
expected: []string{
|
|
"src/Gemfile.lock",
|
|
},
|
|
},
|
|
}
|
|
|
|
for _, test := range tests {
|
|
t.Run(test.name, func(t *testing.T) {
|
|
pkgtest.NewCatalogTester().
|
|
FromDirectory(t, test.fixture).
|
|
ExpectsResolverContentQueries(test.expected).
|
|
TestCataloger(t, NewGemFileLockCataloger())
|
|
})
|
|
}
|
|
}
|
|
|
|
func Test_GemSpec_Globs(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
fixture string
|
|
expected []string
|
|
}{
|
|
{
|
|
name: "obtain gemspec files",
|
|
fixture: "test-fixtures/glob-paths",
|
|
expected: []string{
|
|
"specifications/root.gemspec",
|
|
"specifications/pkg/nested.gemspec",
|
|
},
|
|
},
|
|
}
|
|
|
|
for _, test := range tests {
|
|
t.Run(test.name, func(t *testing.T) {
|
|
pkgtest.NewCatalogTester().
|
|
FromDirectory(t, test.fixture).
|
|
ExpectsResolverContentQueries(test.expected).
|
|
TestCataloger(t, NewGemSpecCataloger())
|
|
})
|
|
}
|
|
}
|