Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var whiteSpaceRegex = regexp.MustCompile("name cannot contain whitespace")
- func TestAccItem_WhitespaceName(t *testing.T) {
- resource.Test(t, resource.TestCase{
- Providers: testAccProviders,
- Steps: []resource.TestStep{
- {
- Config: testAccCheckItemWhitespace(),
- ExpectError: whiteSpaceRegex,
- },
- },
- })
- }
- func testAccCheckItemWhitespace() string {
- return fmt.Sprintf(`
- resource "example_item" "test_item" {
- name = "test with whitespace"
- description = "hello"
- tags = [
- "tag1",
- "tag2",
- ]
- }
- `)
- }
Add Comment
Please, Sign In to add comment