Skip to content

Commit

Permalink
sequence test as truthy
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsaw committed Jul 27, 2018
1 parent 600f584 commit 94f46b4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package resolvers

import (
"encoding/json"
"fmt"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand All @@ -26,13 +25,13 @@ func newGraphQLError(t string, m string, d interface{}) *graphQLError {
}
}

func sequence(ch chan string, seq ...string) error {
for i, str := range seq {
func sequence(ch chan string, seq ...string) bool {
for _, str := range seq {
if msg := <-ch; msg != str {
return fmt.Errorf("[%d] expected %s, got %s", i, str, msg)
return false
}
}
return nil
return true
}

var _ = Describe("Middleware", func() {
Expand Down Expand Up @@ -91,7 +90,7 @@ var _ = Describe("Middleware", func() {
"handler",
"after 2",
"after 1",
)).ToNot(HaveOccurred())
)).To(BeTrue())
})
})

Expand Down Expand Up @@ -146,7 +145,7 @@ var _ = Describe("Middleware", func() {
"before 1",
"handler",
"after 1",
)).ToNot(HaveOccurred())
)).To(BeTrue())
})
})
})

0 comments on commit 94f46b4

Please sign in to comment.