Trott / music-routes-data

Music Routes data: What musicians played on which tracks?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get rid of fixture for most specs

Trott opened this issue · comments

Instead of a fixture, make Data start with nothing, include a load() method to load from a data directory, and only use a fixture to test the load() function. The CLI may default to the current default data directory. But otherwise, a Data object will just have an empty object. Tests can add the necessary entries themselves to test for rejection of duplicate _ids etc.

This way, the fixture won't become this thing that can never be refactored because you won't know what tests you're making useless, etc.

Each test that needs a fixture should probably have a different fixture, as a general rule. We probably only need three for this. (One for a valid data dir and one for a data dir with missing files and maybe one for a data dir with a malformatted file.)