mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
Merge pull request #10458 from SimonAlling/remove-AssertGoldenBytes
Remove AssertGoldenBytes test helper
This commit is contained in:
commit
c477d697ec
2 changed files with 2 additions and 11 deletions
|
|
@ -40,15 +40,6 @@ type HelperT interface {
|
|||
Helper()
|
||||
}
|
||||
|
||||
// AssertGoldenBytes asserts that the give actual content matches the contents of the given filename
|
||||
func AssertGoldenBytes(t TestingT, actual []byte, filename string) {
|
||||
t.Helper()
|
||||
|
||||
if err := compare(actual, path(filename)); err != nil {
|
||||
t.Fatalf("%v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// AssertGoldenString asserts that the given string matches the contents of the given file.
|
||||
func AssertGoldenString(t TestingT, actual, filename string) {
|
||||
t.Helper()
|
||||
|
|
@ -66,7 +57,7 @@ func AssertGoldenFile(t TestingT, actualFileName string, expectedFilename string
|
|||
if err != nil {
|
||||
t.Fatalf("%v", err)
|
||||
}
|
||||
AssertGoldenBytes(t, actual, expectedFilename)
|
||||
AssertGoldenString(t, string(actual), expectedFilename)
|
||||
}
|
||||
|
||||
func path(filename string) string {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ func TestList(t *testing.T) {
|
|||
if err := NewDependency().List(tcase.chart, &buf); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
test.AssertGoldenBytes(t, buf.Bytes(), tcase.golden)
|
||||
test.AssertGoldenString(t, buf.String(), tcase.golden)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue