Skip to content

Commit

Permalink
Separate schema files should work
Browse files Browse the repository at this point in the history
When abstract schema is written in a separate file, reading schemas
process terminates in failure. Fix bug and tests to try read
multiple schema files.
  • Loading branch information
Daisuke Morita committed Apr 1, 2016
1 parent 6db4e13 commit 8b9a9fc
Show file tree
Hide file tree
Showing 12 changed files with 520 additions and 512 deletions.
2 changes: 2 additions & 0 deletions db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var _ = Describe("Database operation test", func() {
)

BeforeEach(func() {
Expect(manager.LoadSchemaFromFile("../tests/test_abstract_schema.yaml")).To(Succeed())
Expect(manager.LoadSchemaFromFile("../tests/test_schema.yaml")).To(Succeed())
networkSchema, ok = manager.Schema("network")
Expect(ok).To(BeTrue())
Expand Down Expand Up @@ -258,6 +259,7 @@ var _ = Describe("Database operation test", func() {
BeforeEach(func() {
conn = "test.db"
dbType = "sqlite3"
Expect(manager.LoadSchemaFromFile("../tests/test_abstract_schema.yaml")).To(Succeed())
Expect(manager.LoadSchemaFromFile("../tests/test_schema.yaml")).To(Succeed())
})

Expand Down
2 changes: 1 addition & 1 deletion db/sql/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("Sql", func() {
sqlConn = dbc.(*DB)
Expect(err).ToNot(HaveOccurred())
Expect(manager.LoadSchemasFromFiles(
"../../etc/schema/gohan.json", "../../tests/test_schema.yaml")).To(Succeed())
"../../etc/schema/gohan.json", "../../tests/test_abstract_schema.yaml", "../../tests/test_schema.yaml")).To(Succeed())
db.InitDBWithSchemas(dbType, conn, true, false)

// Insert fixture data
Expand Down
Loading

0 comments on commit 8b9a9fc

Please sign in to comment.