diff --git a/api_suite_test.go b/api_suite_test.go index 3dd7eafd..5a3c166d 100644 --- a/api_suite_test.go +++ b/api_suite_test.go @@ -16,8 +16,8 @@ package brokerapi_test import ( - "fmt" - "io/ioutil" + "embed" + "io" "path" "testing" @@ -31,14 +31,15 @@ func TestAPI(t *testing.T) { RunSpecs(t, "API Suite") } +//go:embed fixtures/*.json +var fixtures embed.FS + func fixture(name string) string { - filePath := path.Join("fixtures", name) - contents, err := ioutil.ReadFile(filePath) - if err != nil { - panic(fmt.Sprintf("Could not read fixture: %s", name)) - } + GinkgoHelper() - return string(contents) + fh := must(fixtures.Open(path.Join("fixtures", name))) + defer fh.Close() + return string(must(io.ReadAll(fh))) } func uniqueID() string { diff --git a/fixtures/invalid_async_provision_error.json b/fixtures/invalid_async_provision_error.json deleted file mode 100644 index 4507fe97..00000000 --- a/fixtures/invalid_async_provision_error.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "broker attempted to provision asynchronously when not supported by the caller" -}