lib/munit.js
function( name, options, callback ) {
		var ns = munit.ns,
			parts = name.split( rpathsplit ),
			finalPart = parts.pop(),
			opts = munit.extend( true, {}, munit.defaults.settings ),
			assert = null,
			path = '';

		// Filter through all parents
		parts.forEach(function( mod ) {
			// Update the path
			if ( path.length ) {
				path += '.';
			}
			path += mod;

			// Assign assert module
			if ( ! ns[ mod ] ) {
				assert = ns[ mod ] = new munit.Assert( path, assert, opts );
			}

			// Trickle down the path
			assert = ns[ mod ];
			ns = assert.ns;
			opts = munit.extend( true, {}, opts, assert.options );
		});

		// Module already exists, update it
		if ( ns[ finalPart ] ) {
			assert = ns[ finalPart ];

			// Test module is already in use, code setup is wrong
			if ( assert.callback ) {
				throw new munit.AssertionError( "'" + name + "' module has already been created", munit._createModule );
			}
			
			assert.options = munit.extend( true, {}, opts, options );
			assert.callback = callback;
		}
		else {
			options = munit.extend( true, {}, opts, options );
			assert = ns[ finalPart ] = new munit.Assert( name, assert, options, callback );
		}

		// Return the assertion module for use
		return assert;
	}
function( name, options, callback ) {
		var ns = munit.ns,
			parts = name.split( rpathsplit ),
			finalPart = parts.pop(),
			opts = munit.extend( true, {}, munit.defaults.settings ),
			assert = null,
			path = '';

		// Filter through all parents
		parts.forEach(function( mod ) {
			// Update the path
			if ( path.length ) {
				path += '.';
			}
			path += mod;

			// Assign assert module
			if ( ! ns[ mod ] ) {
				assert = ns[ mod ] = new munit.Assert( path, assert, opts );
			}

			// Trickle down the path
			assert = ns[ mod ];
			ns = assert.ns;
			opts = munit.extend( true, {}, opts, assert.options );
		});

		// Module already exists, update it
		if ( ns[ finalPart ] ) {
			assert = ns[ finalPart ];

			// Test module is already in use, code setup is wrong
			if ( assert.callback ) {
				throw new munit.AssertionError( "'" + name + "' module has already been created", munit._createModule );
			}
			
			assert.options = munit.extend( true, {}, opts, options );
			assert.callback = callback;
		}
		else {
			options = munit.extend( true, {}, opts, options );
			assert = ns[ finalPart ] = new munit.Assert( name, assert, options, callback );
		}

		// Return the assertion module for use
		return assert;
	}
function ( name , options , callback ) { var ns = munit . ns , parts = name . split ( rpathsplit ) , finalPart = parts . pop ( ) , opts = munit . extend ( true , { } , munit . defaults . settings ) , assert = null , path = '' ; // Filter through all parents parts . forEach ( function ( mod ) { // Update the path if ( path . length ) { path += '.' ; } path += mod ; // Assign assert module if ( ! ns [ mod ] ) { assert = ns [ mod ] = new munit . Assert ( path , assert , opts ) ; } // Trickle down the path assert = ns [ mod ] ; ns = assert . ns ; opts = munit . extend ( true , { } , opts , assert . options ) ; } ) ; // Module already exists, update it if ( ns [ finalPart ] ) { assert = ns [ finalPart ] ; // Test module is already in use, code setup is wrong if ( assert . callback ) { throw new munit . AssertionError ( "'" + name + "' module has already been created" , munit . _createModule ) ; } assert . options = munit . extend ( true , { } , opts , options ) ; assert . callback = callback ; } else { options = munit . extend ( true , { } , opts , options ) ; assert = ns [ finalPart ] = new munit . Assert ( name , assert , options , callback ) ; } // Return the assertion module for use return assert ; }
Internal module creation
Internal module creation