From 69b01caba75badd9915a949224a1c9fd8640d096 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 9 Jul 2020 15:33:48 -0400 Subject: [PATCH] update scope tests to use new generic scope Signed-off-by: Alfredo Deza --- imgbom/scope/scope_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/imgbom/scope/scope_test.go b/imgbom/scope/scope_test.go index e663c08af..a516888a0 100644 --- a/imgbom/scope/scope_test.go +++ b/imgbom/scope/scope_test.go @@ -17,21 +17,18 @@ func TestDirectoryScope(t *testing.T) { { desc: "no paths exist", input: "foobar/", - expString: "dir://foobar/", inputPaths: []file.Path{file.Path("/opt/"), file.Path("/other")}, expRefs: 0, }, { desc: "path detected", input: "test-fixtures", - expString: "dir://test-fixtures", inputPaths: []file.Path{file.Path("path-detected")}, expRefs: 1, }, { desc: "no files-by-path detected", input: "test-fixtures", - expString: "dir://test-fixtures", inputPaths: []file.Path{file.Path("no-path-detected")}, expRefs: 0, }, @@ -39,11 +36,12 @@ func TestDirectoryScope(t *testing.T) { for _, test := range testCases { t.Run(test.desc, func(t *testing.T) { p, err := NewDirScope(test.input, AllLayersScope) + if err != nil { t.Errorf("could not create NewDirScope: %w", err) } - if p.String() != test.expString { - t.Errorf("mismatched stringer: '%s' != '%s'", p.String(), test.expString) + if p.dirSrc.Path != test.input { + t.Errorf("mismatched stringer: '%s' != '%s'", p.dirSrc.Path, test.input) } refs, err := p.FilesByPath(test.inputPaths...)