Issue title: Port tests to Haskell
 Issue body: Right now the tests are hacked together in Python, and this is an issue because:
- new contributors need to know also Python instead of just Haskell
- the setup is really fiddly - e.g. if the tests fail halfway through one has to remove files by hand
 Comments: 
 Comment 0: I can do this (using Hspec, unless you prefer otherwise).
 Comment 1: @Dretch that would be great!

A couple of notes:
- `hspec` sounds great, but note that I'd like to avoid calling the Haskell functions and I think we should just call the executable (like it is right now - this ensures we test end-to-end the CLI parser, etc), so I'd be fine even with something [like this](https://github.com/justinwoo/update-fetch-derivations/blob/e749bf65b9a0b6243087013e98aa5bbe9ee5a045/test/test.hs)
  The fact that we have to call the executable in tests means that the workflow for running tests should be either:
  - `stack install && stack test` (so the tests run with the system's `spago`)
  - or just `stack test`, where in the test code we call `stack build` and then figure out the path to the executable (I think the command for that is `stack path --local-install-root`)
- One of the problems of the current setup is that if the tests fail, then the cleanup of the temporary files doesn't happen. So in this new setup we should always clean up after a test (and either run all tests in parallel in temp directories, or sequentially in one)
- A related problem is that tests are often coupled: basically the whole test setup is a continuous sequence of commands (i.e. the subsequent commands "innherit" the environment from the previous ones) and we test that those combinations work. The reason is that sometimes it makes sense to see that a command executes correctly and "fixes" a problem introduced by the previous one, and so on.
  I can detail more on which sequences are good to keep after we have a first draft of the port
{'source': 'GithubIssues', 'repo_name_with_owner': 'spacchetti/spago', 'issue_id': 439217193, 'repo_stars': 392.0}