-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b3ed48
commit a9eaa8d
Showing
17 changed files
with
161 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package common | ||
|
||
import "github.com/opencontrol/compliance-masonry/tools/constants" | ||
|
||
// Entry is a generic holder for handling the specific location and revision of a resource. | ||
type Entry struct { | ||
URL string `yaml:"url"` | ||
Revision string `yaml:"revision"` | ||
Path string `yaml:"path"` | ||
} | ||
|
||
// GetConfigFile is a getter for the config file name. Will return DefaultConfigYaml value if none has been set. | ||
func (e Entry) GetConfigFile() string { | ||
if e.Path == "" { | ||
return constants.DefaultConfigYaml | ||
} | ||
return e.Path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package common | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
"github.com/onsi/ginkgo/extensions/table" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/opencontrol/compliance-masonry/tools/constants" | ||
) | ||
|
||
var _ = Describe("Entry", func() { | ||
Describe("Retrieving the config file", func() { | ||
table.DescribeTable("GetConfigFile", func(e Entry, expectedPath string) { | ||
assert.Equal(GinkgoT(), e.GetConfigFile(), expectedPath) | ||
}, | ||
table.Entry("Empty / new base struct to return default", Entry{}, constants.DefaultConfigYaml), | ||
table.Entry("overriden config file path", Entry{Path: "samplepath"}, "samplepath"), | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package resources_test | ||
package resources | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.