Skip to content

Commit

Permalink
added error handlers for database baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
bgildson committed Aug 8, 2020
1 parent fb0eda9 commit ede8c20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/database/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func TestNewJSONDatabase(t *testing.T) {

func TestJSONDatabaseGet(t *testing.T) {
basePath, err := os.Getwd()
if err != nil {
t.Errorf("could not get database base url")
}
gamesPath := path.Join(basePath, "..", "..", "fixtures", "games.json")
d, err := NewJSONDatabase(gamesPath)
if err != nil {
Expand Down Expand Up @@ -112,6 +115,9 @@ func TestJSONDatabaseGet(t *testing.T) {

func TestJSONDatabaseGetByID(t *testing.T) {
basePath, err := os.Getwd()
if err != nil {
t.Errorf("could not get database base url")
}
gamesPath := path.Join(basePath, "..", "..", "fixtures", "games.json")
d, err := NewJSONDatabase(gamesPath)
if err != nil {
Expand Down

0 comments on commit ede8c20

Please sign in to comment.