package checks_test

import (
	. "checks"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Consul DNS checks", func() {
	It("returns an error when host is not known", func() {
		err := ConsulDnsCheck("non-existent.example.com.")
		Expect(err.Error()).To(ContainSubstring("Failed to resolve consul host non-existent.example.com."))
	})

	It("does not return an error when host is known", func() {
		Expect(ConsulDnsCheck("localhost")).To(Succeed())
	})
})

package checks_test

import (
	. "checks"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Consul DNS checks", func() {
	It("returns an error when host is not known", func() {
		err := ConsulDnsCheck("host-non-existing.")
		Expect(err).To(MatchError("Failed to resolve consul host host-non-existing.\nlookup host-non-existing.: getaddrinfow: No such host is known."))
	})

	It("does not return an error when host is known", func() {
		Expect(ConsulDnsCheck("localhost")).To(Succeed())
	})
})

--- 
+++ 
@@ -9,8 +9,8 @@
 
 var _ = Describe("Consul DNS checks", func() {
 	It("returns an error when host is not known", func() {
-		err := ConsulDnsCheck("host-non-existing.")
-		Expect(err).To(MatchError("Failed to resolve consul host host-non-existing.\nlookup host-non-existing.: getaddrinfow: No such host is known."))
+		err := ConsulDnsCheck("non-existent.example.com.")
+		Expect(err.Error()).To(ContainSubstring("Failed to resolve consul host non-existent.example.com."))
 	})
 
 	It("does not return an error when host is known", func() {
Fix consul dns check to not test OS specific messages

Signed-off-by: Ben Moss <80bec717c12290923c80384e0a5fc28cdf75a97e@pivotal.io>
