Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created version module to provide additional version information
- Loading branch information
1 parent
4627958
commit 958521f
Showing
5 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
); | ||
}, | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters