Skip to content

Commit

Permalink
test: expect error should not have occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgaOzen committed Nov 18, 2023
1 parent dde330f commit 48d005d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/schema/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ var _ = Describe("Loader", func() {
Context("LoadSchema function", func() {
It("should load schema from URL", func() {
loader := NewSchemaLoader()
schema, _ := loader.LoadSchema("https://gist.githubusercontent.com/neo773/d50f089c141bf61776c22157413ddbac/raw/ed2eb12108e49fce11be27d0387b8b01912b9d98/gistfile1.txt")
schema, err := loader.LoadSchema("https://gist.githubusercontent.com/neo773/d50f089c141bf61776c22157413ddbac/raw/ed2eb12108e49fce11be27d0387b8b01912b9d98/gistfile1.txt")
Expect(err).ShouldNot(HaveOccurred())

expectedSchema := `
entity userhttp {}
Expand Down Expand Up @@ -40,7 +42,9 @@ var _ = Describe("Loader", func() {

It("should load schema from file", func() {
loader := NewSchemaLoader()
schema, _ := loader.LoadSchema("./schema.txt")
schema, err := loader.LoadSchema("./schema.txt")
Expect(err).ShouldNot(HaveOccurred())

expectedSchema := `
entity userfs {}
Expand Down Expand Up @@ -69,7 +73,7 @@ var _ = Describe("Loader", func() {

It("should load inline schema", func() {
loader := NewSchemaLoader()
schema, _ := loader.LoadSchema(`entity userinline {}
schema, err := loader.LoadSchema(`entity userinline {}
entity organization {
Expand All @@ -91,6 +95,8 @@ var _ = Describe("Loader", func() {
action edit = parent.member not owner
}`)

Expect(err).ShouldNot(HaveOccurred())

expectedSchema := `
entity userinline {}
Expand Down

0 comments on commit 48d005d

Please sign in to comment.