petejkim/expecta — pull request #23 by chrisdevereux (2012-12-20 02:58:35+00:00)
Title: Fixes crash when passing a block to expect()

Was crashing in the `raise` and `raiseAny` matchers, and generally whenever I pass a block to `expect()`. Tracked it down to _EXPObjectify treating the block as an ordinary object and failing to copy it.

Annoyingly, `@encode(EXPBasicBlock)` doesn't return a proper type encoding, it returns `"@?"`, which is treated as an ordinary object because the condition `strstr(type, @encode(id)) != NULL) || (strstr(type, @encode(Class)) != 0)` returns true.

I'm working around by moving the check for EXPBasicBlock before the check for id/class. Can't think of a better way to decide whether the object needs to be copied...