github.com/lonnblad/godog@v0.7.14-0.20200306004719-1b0cb3259847/_examples/db/README.md (about)

     1  # An example of API with DB
     2  
     3  The following example demonstrates steps how we describe and test our API with DB using **godog**.
     4  To start with, see [API example](https://github.com/cucumber/godog/tree/master/examples/api) before.
     5  We have extended it to be used with database.
     6  
     7  The interesting point is, that we have [go-txdb](https://github.com/DATA-DOG/go-txdb) library,
     8  which has an implementation of custom sql.driver to allow execute every and each scenario
     9  within a **transaction**. After it completes, transaction is rolled back so the state could
    10  be clean for the next scenario.
    11  
    12  To run **users.feature** you need MySQL installed on your system with an anonymous root password.
    13  Then run:
    14  
    15      make test
    16  
    17  The json comparisom function should be improved and we should also have placeholders for primary
    18  keys when comparing a json result.