Guest User

Untitled

a guest
Nov 14th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. var whiteSpaceRegex = regexp.MustCompile("name cannot contain whitespace")
  2.  
  3. func TestAccItem_WhitespaceName(t *testing.T) {
  4. resource.Test(t, resource.TestCase{
  5. Providers: testAccProviders,
  6. Steps: []resource.TestStep{
  7. {
  8. Config: testAccCheckItemWhitespace(),
  9. ExpectError: whiteSpaceRegex,
  10. },
  11. },
  12. })
  13. }
  14.  
  15. func testAccCheckItemWhitespace() string {
  16. return fmt.Sprintf(`
  17. resource "example_item" "test_item" {
  18. name = "test with whitespace"
  19. description = "hello"
  20.  
  21. tags = [
  22. "tag1",
  23. "tag2",
  24. ]
  25. }
  26. `)
  27. }
Add Comment
Please, Sign In to add comment