Testing Undo

Gus Mueller: “The idea being that I call multiple operations in quick succession (from JSTalk) and then test each of those undos and make sure the state is exactly what it should be. I recently came across an instance where I needed to do the same thing in Objective-C code, so I thought I’d share with my fair readers the solution I came up with (experienced Obj-C coders will probably know right away what the solution is).”

AKA – Fun with blocks.