terraform/builtin/providers/dns/data_dns_cname_record_set_t...

38 lines
680 B
Go
Raw Normal View History

2017-03-15 23:11:19 +01:00
package dns
import (
"testing"
r "github.com/hashicorp/terraform/helper/resource"
)
func TestAccDnsCnameRecordSet_Basic(t *testing.T) {
tests := []struct {
DataSourceBlock string
Expected string
}{
{
`
data "dns_cname_record_set" "foo" {
host = "www.hashicorp.com"
}
`,
"dualstack.s.shared.global.fastly.net.",
2017-03-15 23:11:19 +01:00
},
}
for _, test := range tests {
r.UnitTest(t, r.TestCase{
Providers: testAccProviders,
Steps: []r.TestStep{
r.TestStep{
Config: test.DataSourceBlock,
Check: r.ComposeTestCheckFunc(
r.TestCheckResourceAttr("data.dns_cname_record_set.foo", "cname", test.Expected),
),
},
},
})
}
}