December 2021
Intermediate to advanced
510 pages
11h 20m
English
In Testing the Pomodoro Functionality, you wrote tests for the pomodoro package using a helper function getRepo to obtain the repository. At that time, only the inMemory repository was available. Now that you’ve added the sqlite3 repository, you’ll provide an alternative version of this function that returns the new repository. You can control when to use each by applying build tags. Switch back to the pomodoro package directory and create a file named sqlite3_test.go:
| | $ cd $HOME/pragprog.com/rggo/persistentDataSQL/pomo/pomodoro |
Open the sqlite3_test.go file in your editor to write the specific function for this repository implementation. Add the build tag +build !inmemory to use this file unless ...
Read now
Unlock full access