-
Notifications
You must be signed in to change notification settings - Fork 134
Machinist 2
Machinist 2 gives you the convenience of Machinist, with the performance of fixtures.
When you create an object, Machinist 2 keeps the object around in the database. If, in a later test, you request an identical object, Machinist will give you the cached copy.
See the page on Object Caching for more information.
Other features:
- Simpler API and simpler implementation
- Better handling of has_many and has_and_belongs_to_many relationships
Machinist 2 is not a drop-in replacement for Machinist 1. Implementing caching has required substantial changes to the API.
- Sham has gone away.
- make
has become make!
, and make_unsaved
has become make
.
- You can no longer refer directly to other attributes when defining an attribute in a blueprint; use object
instead.
- Replace calls to make
with calls to make!
, except within your blueprints.
- Replace calls to make_unsaved
with calls to make
.
- Delete all your Sham definitions, and provide explicit attribute values in all your blueprints. See Serial Numbers for information on handling unique attributes.