Faker Maker

Faker Maker

Factories over fixtures

When you're testing, you need test data. Fixtures are pre-cooked, static chunks of test data that you can use in your test cases.

Fixtures suck.

The problem with them is that they are fixed. If your API changes (it will), you've got to go and update all this static data and make sure it's valid. This pressure leads to fewer test cases.

Use factories to build your test data instead. Faker Maker is a Ruby library designed to make building test objects really easy allowing you to control the data items you need to control and have variability in those you don't.

Hat tip to Mailtrap for the mention.