spec/lib/jspec.js
function(actual) {
      function assert(matcher, args, negate) {
        var expected = toArray(args, 1)
        matcher.negate = negate  
        assertion = new JSpec.Assertion(matcher, actual, expected, negate)
        hook('beforeAssertion', assertion)
        if (matcher.defer) assertion.run()
        else JSpec.currentSpec.assertions.push(assertion.run().report()), hook('afterAssertion', assertion)
        return assertion.result
      }
      
      function to(matcher) {
        return assert(matcher, arguments, false)
      }
      
      function not_to(matcher) {
        return assert(matcher, arguments, true)
      }
      
      return {
        to : to,
        should : to,
        not_to: not_to,
        should_not : not_to
      }
    }
function(actual) {
      function assert(matcher, args, negate) {
        var expected = toArray(args, 1)
        matcher.negate = negate  
        assertion = new JSpec.Assertion(matcher, actual, expected, negate)
        hook('beforeAssertion', assertion)
        if (matcher.defer) assertion.run()
        else JSpec.currentSpec.assertions.push(assertion.run().report()), hook('afterAssertion', assertion)
        return assertion.result
      }
      
      function to(matcher) {
        return assert(matcher, arguments, false)
      }
      
      function not_to(matcher) {
        return assert(matcher, arguments, true)
      }
      
      return {
        to : to,
        should : to,
        not_to: not_to,
        should_not : not_to
      }
    }
function ( actual ) { function assert ( matcher , args , negate ) { var expected = toArray ( args , 1 ) matcher . negate = negate assertion = new JSpec . Assertion ( matcher , actual , expected , negate ) hook ( 'beforeAssertion' , assertion ) if ( matcher . defer ) assertion . run ( ) else JSpec . currentSpec . assertions . push ( assertion . run ( ) . report ( ) ) , hook ( 'afterAssertion' , assertion ) return assertion . result } function to ( matcher ) { return assert ( matcher , arguments , false ) } function not_to ( matcher ) { return assert ( matcher , arguments , true ) } return { to : to , should : to , not_to : not_to , should_not : not_to } }
Perform an assertion.

expect(true).to('be', true)
expect('foo').not_to('include', 'bar')
expect([1, [2]]).to('include', 1, [2])

@param  {mixed} actual
@return {hash}
@api public
Perform an assertion .