Avoiding Test Data Mutation

Say we have a service object, with a dependency injected. The service performs an operation with data obtained from the dependency. For simplicity in this example, let’s say the service would wrap the data into a response hash, with keys success indicating successful operation and data containing the result »

How to Start TDD?

Simply said, TDD is the practice of writing tests first before implementing the code. It starts with writing down the code behaviour we wish to have as tests, followed by the implementation. This is done one step at a time, switching between tests and implementation. In TDD, we let the »