Skip to content

Commit

Permalink
Fix error regexp for storage bucket website test
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
emilymye authored and modular-magician committed Jan 17, 2020
1 parent cfbbb32 commit ce7e1c3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions google-beta/resource_storage_bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,10 +851,7 @@ func TestAccStorageBucket_website(t *testing.T) {
t.Parallel()

bucketSuffix := acctest.RandomWithPrefix("tf-website-test")

websiteKeys := []string{"website.0.main_page_suffix", "website.0.not_found_page"}
errMsg := fmt.Sprintf("one of `%s` must be specified", strings.Join(websiteKeys, ","))
fullErr := fmt.Sprintf("config is invalid: 2 problems:\n\n- \"%s\": %s\n- \"%s\": %s", websiteKeys[0], errMsg, websiteKeys[1], errMsg)
errRe := regexp.MustCompile("one of `((website.0.main_page_suffix,website.0.not_found_page)|(website.0.not_found_page,website.0.main_page_suffix))` must be specified")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -863,7 +860,7 @@ func TestAccStorageBucket_website(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccStorageBucket_websiteNoAttributes(bucketSuffix),
ExpectError: regexp.MustCompile(fullErr),
ExpectError: errRe,
},
{
Config: testAccStorageBucket_websiteOneAttribute(bucketSuffix),
Expand Down

0 comments on commit ce7e1c3

Please sign in to comment.