From 2b3bcd5c271f21e4bed53fd6e82280516720f21f Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Mon, 2 Mar 2015 10:00:45 -0600 Subject: [PATCH] add simple test for expandInstanceString --- builtin/providers/aws/structure_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/builtin/providers/aws/structure_test.go b/builtin/providers/aws/structure_test.go index 580fc9cdf..618ae0943 100644 --- a/builtin/providers/aws/structure_test.go +++ b/builtin/providers/aws/structure_test.go @@ -312,3 +312,22 @@ func Test_flattenParameters(t *testing.T) { } } } + +func Test_expandInstanceString(t *testing.T) { + + expected := []elb.Instance{ + elb.Instance{aws.String("test-one")}, + elb.Instance{aws.String("test-two")}, + } + + ids := []interface{}{ + "test-one", + "test-two", + } + + expanded := expandInstanceString(ids) + + if !reflect.DeepEqual(expanded, expected) { + t.Fatalf("Expand Instance String output did not match.\nGot:\n%#v\n\nexpected:\n%#v", expanded, expected) + } +}