parent
4627958247
commit
958521f673
2
index.js
2
index.js
|
@ -25,5 +25,5 @@ exports.Class = require( __dirname + '/lib/class' );
|
||||||
exports.AbstractClass = require( __dirname + '/lib/class_abstract' );
|
exports.AbstractClass = require( __dirname + '/lib/class_abstract' );
|
||||||
exports.FinalClass = require( __dirname + '/lib/class_final' );
|
exports.FinalClass = require( __dirname + '/lib/class_final' );
|
||||||
exports.Interface = require( __dirname + '/lib/interface' );
|
exports.Interface = require( __dirname + '/lib/interface' );
|
||||||
exports.version = '0.1.0';
|
exports.version = require( __dirname + '/lib/version' );
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* Provides version information
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010,2011 Mike Gerwitz
|
||||||
|
*
|
||||||
|
* This file is part of ease.js.
|
||||||
|
*
|
||||||
|
* ease.js is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
* Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @author Mike Gerwitz
|
||||||
|
*/
|
||||||
|
|
||||||
|
var major = 0,
|
||||||
|
minor = 1,
|
||||||
|
rev = 0,
|
||||||
|
|
||||||
|
version = [ major, minor, rev ];
|
||||||
|
|
||||||
|
version.major = major;
|
||||||
|
version.minor = minor;
|
||||||
|
version.rev = rev;
|
||||||
|
|
||||||
|
version.toString = function()
|
||||||
|
{
|
||||||
|
return this.join( '.' );
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = version;
|
|
@ -0,0 +1,70 @@
|
||||||
|
/**
|
||||||
|
* Tests version.js
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010,2011 Mike Gerwitz
|
||||||
|
*
|
||||||
|
* This file is part of ease.js.
|
||||||
|
*
|
||||||
|
* ease.js is free software: you can redistribute it and/or modify it under the
|
||||||
|
* terms of the GNU Lesser General Public License as published by the Free
|
||||||
|
* Software Foundation, either version 3 of the License, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
|
* for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @author Mike Gerwitz
|
||||||
|
*/
|
||||||
|
|
||||||
|
require( 'common' ).testCase(
|
||||||
|
{
|
||||||
|
caseSetUp: function()
|
||||||
|
{
|
||||||
|
this.version = this.require( 'version' );
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Can retrieve major version number': function()
|
||||||
|
{
|
||||||
|
this.assertOk( typeof this.version.major === 'number',
|
||||||
|
'Major version number should be available'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Can retrieve minor version number': function()
|
||||||
|
{
|
||||||
|
this.assertOk( typeof this.version.minor === 'number',
|
||||||
|
'Minor version number should be available'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Can retrieve revision version number': function()
|
||||||
|
{
|
||||||
|
this.assertOk( typeof this.version.rev === 'number',
|
||||||
|
'Revision version number should be available'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Array of version numbers is available': function()
|
||||||
|
{
|
||||||
|
this.assertEqual( this.version.major, this.version[ 0 ] );
|
||||||
|
this.assertEqual( this.version.minor, this.version[ 1 ] );
|
||||||
|
this.assertEqual( this.version.rev, this.version[ 2 ] );
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
'Version string is available': function()
|
||||||
|
{
|
||||||
|
this.assertEqual( this.version.join( '.' ), this.version.toString(),
|
||||||
|
'Version string should be made available'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
} );
|
|
@ -28,6 +28,7 @@ var common = require( './common' ),
|
||||||
AbstractClass = common.require( 'class_abstract' ),
|
AbstractClass = common.require( 'class_abstract' ),
|
||||||
FinalClass = common.require( 'class_final' ),
|
FinalClass = common.require( 'class_final' ),
|
||||||
Interface = common.require( 'interface' ),
|
Interface = common.require( 'interface' ),
|
||||||
|
version = common.require( 'version' ),
|
||||||
|
|
||||||
index = require( '../' );
|
index = require( '../' );
|
||||||
|
|
||||||
|
@ -52,8 +53,7 @@ assert.ok(
|
||||||
"Interface should be made available"
|
"Interface should be made available"
|
||||||
);
|
);
|
||||||
|
|
||||||
assert.ok(
|
assert.ok( ( index.version === version ),
|
||||||
( typeof index.version === 'string' ),
|
|
||||||
"Version information should be exported"
|
"Version information should be exported"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,6 @@ var easejs = {};
|
||||||
ns_exports.AbstractClass = module['class_abstract'].exports;
|
ns_exports.AbstractClass = module['class_abstract'].exports;
|
||||||
ns_exports.FinalClass = module['class_final'].exports;
|
ns_exports.FinalClass = module['class_final'].exports;
|
||||||
ns_exports.Interface = module['interface'].exports;
|
ns_exports.Interface = module['interface'].exports;
|
||||||
ns_exports.version = '0.1.0';
|
ns_exports.version = module['version'].exports;
|
||||||
} )( easejs );
|
} )( easejs );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue