lib/adapter.js
function BenderReporter() {
		var timer = new jasmine.Timer(),
			current = new Suite(),
			passed = 0,
			failed = 0,
			errors = 0,
			ignored = 0,
			total = 0;

		function buildError( result ) {
			var pattern = /\n.*jasmine.js.*/gi,
				error = [],
				exp,
				i;

			for ( i = 0; i < result.failedExpectations.length; i++ ) {
				errors++;

				exp = result.failedExpectations[ i ];

				if ( exp.stack ) {
					if ( exp.stack.indexOf( exp.message ) === -1 ) {
						error.push( exp.message );
					}

					error.push(
						exp.stack
						.replace( pattern, '' )
					);
				} else {
					error.push( exp.message );
				}
			}

			return error.join( '\n' );
		}

		this.jasmineStarted = function() {
			timer.start();
		};

		this.jasmineDone = function() {
			bender.next( {
				duration: timer.elapsed(),
				passed: passed,
				failed: failed,
				errors: errors,
				ignored: ignored,
				total: total,
				coverage: window.__coverage__
			} );
		};

		this.suiteStarted = function( suite ) {
			current = new Suite( suite.description, current );
		};

		this.suiteDone = function() {
			current = current.parent;
		};

		this.specStarted = function( result ) {
			total++;
			result.startTime = +new Date();
		};

		this.specDone = function( result ) {
			var modules = [], p = current;

			while ( p ) {
				if ( p.name ) {
					modules.push( p.name );
				}

				p = p.parent;
			}

			result.module = modules.reverse().join( ' / ' );
			result.name = result.description;
			result.success = true;
			result.duration = +new Date() - result.startTime;

			if ( result.status === 'passed' ) {
				passed++;
			} else if ( result.status === 'disabled' || result.status === 'pending' ) {
				result.ignored = true;
				ignored++;
			} else {
				result.success = false;
				result.error = buildError( result );
				result.errors = errors;
				failed++;
			}

			bender.result( result );
		};
	}
function BenderReporter() {
		var timer = new jasmine.Timer(),
			current = new Suite(),
			passed = 0,
			failed = 0,
			errors = 0,
			ignored = 0,
			total = 0;

		function buildError( result ) {
			var pattern = /\n.*jasmine.js.*/gi,
				error = [],
				exp,
				i;

			for ( i = 0; i < result.failedExpectations.length; i++ ) {
				errors++;

				exp = result.failedExpectations[ i ];

				if ( exp.stack ) {
					if ( exp.stack.indexOf( exp.message ) === -1 ) {
						error.push( exp.message );
					}

					error.push(
						exp.stack
						.replace( pattern, '' )
					);
				} else {
					error.push( exp.message );
				}
			}

			return error.join( '\n' );
		}

		this.jasmineStarted = function() {
			timer.start();
		};

		this.jasmineDone = function() {
			bender.next( {
				duration: timer.elapsed(),
				passed: passed,
				failed: failed,
				errors: errors,
				ignored: ignored,
				total: total,
				coverage: window.__coverage__
			} );
		};

		this.suiteStarted = function( suite ) {
			current = new Suite( suite.description, current );
		};

		this.suiteDone = function() {
			current = current.parent;
		};

		this.specStarted = function( result ) {
			total++;
			result.startTime = +new Date();
		};

		this.specDone = function( result ) {
			var modules = [], p = current;

			while ( p ) {
				if ( p.name ) {
					modules.push( p.name );
				}

				p = p.parent;
			}

			result.module = modules.reverse().join( ' / ' );
			result.name = result.description;
			result.success = true;
			result.duration = +new Date() - result.startTime;

			if ( result.status === 'passed' ) {
				passed++;
			} else if ( result.status === 'disabled' || result.status === 'pending' ) {
				result.ignored = true;
				ignored++;
			} else {
				result.success = false;
				result.error = buildError( result );
				result.errors = errors;
				failed++;
			}

			bender.result( result );
		};
	}
function BenderReporter ( ) { var timer = new jasmine . Timer ( ) , current = new Suite ( ) , passed = 0 , failed = 0 , errors = 0 , ignored = 0 , total = 0 ; function buildError ( result ) { var pattern = / \n.*jasmine.js.* / gi , error = [ ] , exp , i ; for ( i = 0 ; i < result . failedExpectations . length ; i ++ ) { errors ++ ; exp = result . failedExpectations [ i ] ; if ( exp . stack ) { if ( exp . stack . indexOf ( exp . message ) === - 1 ) { error . push ( exp . message ) ; } error . push ( exp . stack . replace ( pattern , '' ) ) ; } else { error . push ( exp . message ) ; } } return error . join ( '\n' ) ; } this . jasmineStarted = function ( ) { timer . start ( ) ; } ; this . jasmineDone = function ( ) { bender . next ( { duration : timer . elapsed ( ) , passed : passed , failed : failed , errors : errors , ignored : ignored , total : total , coverage : window . __coverage__ } ) ; } ; this . suiteStarted = function ( suite ) { current = new Suite ( suite . description , current ) ; } ; this . suiteDone = function ( ) { current = current . parent ; } ; this . specStarted = function ( result ) { total ++ ; result . startTime = + new Date ( ) ; } ; this . specDone = function ( result ) { var modules = [ ] , p = current ; while ( p ) { if ( p . name ) { modules . push ( p . name ) ; } p = p . parent ; } result . module = modules . reverse ( ) . join ( ' / ' ) ; result . name = result . description ; result . success = true ; result . duration = + new Date ( ) - result . startTime ; if ( result . status === 'passed' ) { passed ++ ; } else if ( result . status === 'disabled' || result . status === 'pending' ) { result . ignored = true ; ignored ++ ; } else { result . success = false ; result . error = buildError ( result ) ; result . errors = errors ; failed ++ ; } bender . result ( result ) ; } ; }
custom reporter that will pass the results to bender
custom reporter that will pass the results to bender