|
20 | 20 | package neo4j
|
21 | 21 |
|
22 | 22 | import (
|
| 23 | + . "github.com/neo4j/neo4j-go-driver/neo4j/utils/test" |
23 | 24 | . "github.com/onsi/ginkgo"
|
24 | 25 | . "github.com/onsi/ginkgo/extensions/table"
|
25 | 26 | . "github.com/onsi/gomega"
|
26 | 27 | )
|
27 | 28 |
|
28 | 29 | var _ = Describe("Driver", func() {
|
29 | 30 |
|
| 31 | + Context("URI", func() { |
| 32 | + It("should support bolt:// scheme", func() { |
| 33 | + driver, err := NewDriver("bolt://localhost:7687", NoAuth()) |
| 34 | + |
| 35 | + Expect(err).To(BeNil()) |
| 36 | + Expect(driver).NotTo(BeNil()) |
| 37 | + Expect(driver.Target().Scheme).To(BeIdenticalTo("bolt")) |
| 38 | + }) |
| 39 | + |
| 40 | + It("should support bolt+routing:// scheme", func() { |
| 41 | + driver, err := NewDriver("bolt+routing://localhost:7687", NoAuth()) |
| 42 | + |
| 43 | + Expect(err).To(BeNil()) |
| 44 | + Expect(driver).NotTo(BeNil()) |
| 45 | + Expect(driver.Target().Scheme).To(BeIdenticalTo("bolt+routing")) |
| 46 | + }) |
| 47 | + |
| 48 | + It("should support neo4j:// scheme", func() { |
| 49 | + driver, err := NewDriver("neo4j://localhost:7687", NoAuth()) |
| 50 | + |
| 51 | + Expect(err).To(BeNil()) |
| 52 | + Expect(driver).NotTo(BeNil()) |
| 53 | + Expect(driver.Target().Scheme).To(BeIdenticalTo("neo4j")) |
| 54 | + }) |
| 55 | + |
| 56 | + It("should error anotherscheme:// scheme", func() { |
| 57 | + driver, err := NewDriver("anotherscheme://localhost:7687", NoAuth()) |
| 58 | + |
| 59 | + Expect(driver).To(BeNil()) |
| 60 | + Expect(err).To(BeGenericError(ContainSubstring("url scheme anotherscheme is not supported"))) |
| 61 | + }) |
| 62 | + }) |
| 63 | + |
30 | 64 | When("constructed with bolt://localhost:7687", func() {
|
31 | 65 | driver, err := NewDriver("bolt://localhost:7687", NoAuth())
|
32 | 66 |
|
|
0 commit comments