spec/lib/jspec.js
function(body) {
      switch (body.constructor) {
        case String:
          if (captures = body.match(/^alias (\w+)/)) return JSpec.matchers[last(captures)]
          if (body.length < 4) body = 'actual ' + body + ' expected'
          return { match: function(actual, expected) { return eval(body) }}  
          
        case Function:
          return { match: body }
          
        default:
          return body
      }
    }
function(body) {
      switch (body.constructor) {
        case String:
          if (captures = body.match(/^alias (\w+)/)) return JSpec.matchers[last(captures)]
          if (body.length < 4) body = 'actual ' + body + ' expected'
          return { match: function(actual, expected) { return eval(body) }}  
          
        case Function:
          return { match: body }
          
        default:
          return body
      }
    }
function ( body ) { switch ( body . constructor ) { case String : if ( captures = body . match ( / ^alias (\w+) / ) ) return JSpec . matchers [ last ( captures ) ] if ( body . length < 4 ) body = 'actual ' + body + ' expected' return { match : function ( actual , expected ) { return eval ( body ) } } case Function : return { match : body } default : return body } }
Normalize a matcher body

This process allows the following conversions until
the matcher is in its final normalized hash state.

- '==' becomes 'actual == expected'
- 'actual == expected' becomes 'return actual == expected'
- function(actual, expected) { return actual == expected } becomes
{ match : function(actual, expected) { return actual == expected }}

@param  {mixed} body
@return {hash}
@api public
Normalize a matcher body