Code samples and information for various talks and demos on ApprovalTests.cpp.
The samples here demonstrate use of ApprovalTests.cpp, which is the C++ implementation of Llewellyn Falco's Approval Tests approach to testing legacy and hard-to-test code.
This evolving repo contains demos used in multiple different talks over time.
There will be different branches for each successive generation of the code, differing in things like which versions of ApprovalTests.cpp and other 3rd-party libraries are used.
For more information, see my list of talks and presentations, with links to any slides and recordings.
Purpose of the sub-directories in this repo:
- catch2_demo/
- Some example uses of ApprovalTests.cpp with the Catch2 test framework, with detailed explanatory comments in the code.
- google_test_demo/
- Some example uses of ApprovalTests.cpp with the Google Test framework, with detailed explanatory comments in the code.
- doctest_demo/
- Minimal example for now, which shows how to set up the main for use with doctest
- include/
- Some code used by the above demos (all files inlined for now, for simplicity)
- specific_examples/
- A small selection of other examples, for example to show answers to specific questions.
- gilded_rose_refactoring_kata
- A worked example of the cpp version of Emily Bache's GildedRose Refactoring Kata
- The ApprovalTests.cpp User Guide also has plenty of code snippets showing how to use the library.