Setup
The following setup and tests can be viewed in the Blog example.Create Test/Main.hs module
Create a new
Test/Main.hs module. Here you will import all your test specs.Execute the tests
You can run tests in multiple ways:- Using ghci
- Using runghc
When entering In this case, follow the suggested fix, exit ghci (
ghci it might give a warning::q) and execute chmod go-w ..Setting the Current User During Testing
UsewithUser to call an action with a specific user during testing: