2023/12
How To Manage Duplicate Test Setup, or Can I Interest You In Weird RSpec?
You have a series of test cases. They cover the same logic with different inputs. In order to get to that logic, there’s some overhead: objects have to be created first. Then there’s more logic needed to evaluate the result.
What’s the best way to manage these tests?
You want it to be easy to add new tests. You also want it to be clear what part of the test is different in each round and what part is just the common logistics.