2014-07-03 02:31:58 +02:00
|
|
|
package resource
|
2014-07-03 02:36:07 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/terraform"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMapResources(t *testing.T) {
|
|
|
|
m := &Map{
|
|
|
|
Mapping: map[string]Resource{
|
|
|
|
"aws_elb": Resource{},
|
|
|
|
"aws_instance": Resource{},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
rts := m.Resources()
|
|
|
|
|
|
|
|
expected := []terraform.ResourceType{
|
|
|
|
terraform.ResourceType{
|
|
|
|
Name: "aws_elb",
|
|
|
|
},
|
|
|
|
terraform.ResourceType{
|
|
|
|
Name: "aws_instance",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(rts, expected) {
|
|
|
|
t.Fatalf("bad: %#v", rts)
|
|
|
|
}
|
|
|
|
}
|