Skip to content

Commit

Permalink
chore: fix tests for latest darwin (#1047)
Browse files Browse the repository at this point in the history
* chore: fix tests for latest darwin

* chore: Use SatisfyAny
  • Loading branch information
petkostas committed Jan 29, 2023
1 parent e297d10 commit aefc634
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions functional-tests/core/ft_tls_verification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"runtime"

"github.com/SpectoLabs/hoverfly/functional-tests"
functional_tests "github.com/SpectoLabs/hoverfly/functional-tests"
"github.com/dghubble/sling"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -51,11 +50,10 @@ var _ = Describe("When I run Hoverfly", func() {

Expect(string(responseBody)).To(ContainSubstring("Hoverfly Error!"))
Expect(string(responseBody)).To(ContainSubstring("There was an error when forwarding the request to the intended destination"))
if runtime.GOOS == "darwin" {
Expect(string(responseBody)).To(ContainSubstring("certificate is not trusted"))
} else {
Expect(string(responseBody)).To(ContainSubstring("x509: certificate signed by unknown authority"))
}
Expect(string(responseBody)).To(SatisfyAny(
ContainSubstring("certificate is not trusted"),
ContainSubstring("x509: certificate signed by unknown authority")),
)
})
})

Expand Down Expand Up @@ -84,12 +82,10 @@ var _ = Describe("When I run Hoverfly", func() {

Expect(string(responseBody)).To(ContainSubstring("Hoverfly Error!"))
Expect(string(responseBody)).To(ContainSubstring("There was an error when forwarding the request to the intended destination"))
if runtime.GOOS == "darwin" {
Expect(string(responseBody)).To(ContainSubstring("certificate is not trusted"))
} else {
Expect(string(responseBody)).To(ContainSubstring("x509: certificate signed by unknown authority"))
}

Expect(string(responseBody)).To(SatisfyAny(
ContainSubstring("certificate is not trusted"),
ContainSubstring("x509: certificate signed by unknown authority")),
)
})
})

Expand Down

0 comments on commit aefc634

Please sign in to comment.