From 04de86d211f5b68fc6d1d238e2efd92ca7f389d9 Mon Sep 17 00:00:00 2001 From: Don Kuntz Date: Mon, 25 Feb 2019 14:19:13 -0600 Subject: [PATCH] Add test for non-boolean values in ssh_private_ip for FixerAmazonPrivateIP --- fix/fixer_amazon_private_ip_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fix/fixer_amazon_private_ip_test.go b/fix/fixer_amazon_private_ip_test.go index 71961f2f8..96f925b97 100644 --- a/fix/fixer_amazon_private_ip_test.go +++ b/fix/fixer_amazon_private_ip_test.go @@ -75,3 +75,19 @@ func TestFixerAmazonPrivateIP(t *testing.T) { } } } + +func TestFixerAmazonPrivateIPNonBoolean(t *testing.T) { + var f FixerAmazonPrivateIP + + input := map[string]interface{}{ + "builders": []map[string]interface{}{map[string]interface{}{ + "type": "amazon-ebs", + "ssh_private_ip": "not-a-boolean-value", + }}, + } + + _, err := f.Fix(input) + if err == nil { + t.Fatal("should have errored") + } +}