Files
syft/syft/pkg/cataloger/ruby/cataloger_test.go
T
Alex Goodman 1cfc4c7387 Normalize cataloger configuration patterns (#2365)
* 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>
2023-11-28 17:02:43 +00:00

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())
})
}
}