'use strict';

// MODULES //

var tape = require( 'tape' );
var repl = require( './../lib' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof repl, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function starts a REPL environment', function test( t ) {
	var r = repl();

	setTimeout( onTimeout, 5000 );

	function onTimeout() {
		r.close();
		t.end();
	}
});

'use strict';

// MODULES //

var tape = require( 'tape' );
var repl = require( './../lib' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof repl, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function starts a REPL environment', function test( t ) {
	var r = repl();

	setTimeout( onTimeout, 5000 );

	function onTimeout() {
		// In Node v0.10, the REPLServer instance does not have a `close()` method...
		if ( r.close ) {
			r.close();
		} else {
			r.rli.close();
		}
		t.end();
	}
});

Add workaround for Node v0.10 where REPLServer does not have a close method
Add workaround for Node v0.10 where REPLServer does not have a close method
