Skip to content

Commit

Permalink
Changed the Date Specs so they can run in NodeJS
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian committed Sep 19, 2010
1 parent f1b621e commit 9233d46
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Specs/1.3/Locale/Locale.js
Expand Up @@ -14,8 +14,8 @@ describe('Locale', function(){
required: 'Ce champ est obligatoire.'
});


it('should return english form validator message', function(){
Locale.use('en-US');
if (MooTools.lang) expect(MooTools.lang.get('FormValidator', 'required')).toEqual('This field is required.');

expect(Locale.get('FormValidator.required')).toEqual('This field is required.');
Expand Down
14 changes: 9 additions & 5 deletions Specs/1.3/Types/Date.js
Expand Up @@ -6,6 +6,8 @@ License:
MIT-style license.
*/

(function(global){

describe('Date.clone', {

'should clone a Date instance': function(){
Expand Down Expand Up @@ -227,7 +229,7 @@ describe('Date.getTimezone', {

'should return the time zone of a Date instance': function(){
var d = new Date(Date.UTC(2000, 0, 1, 1, 1, 1));
if (Browser.Engine.trident) value_of(d.get('timezone')).should_be(new Date(Date.UTC()).get('timezone'));
if (global['Browser'] && Browser.ie) value_of(d.get('timezone')).should_be(new Date(Date.UTC()).get('timezone'));
else value_of(d.get('timezone')).should_be('GMT');
}

Expand Down Expand Up @@ -275,8 +277,8 @@ describe('Date.format', {
value_of(d.format('%I')).should_be('01');
value_of(d.format('%k')).should_be(' 1');
value_of(d2.format('%l')).should_be(' 8');


value_of(d.format('%j')).should_be('324');
value_of(d.format('%m')).should_be('11');
value_of(d.format('%M')).should_be('02');
Expand All @@ -290,7 +292,7 @@ describe('Date.format', {
value_of(d.format('%y')).should_be('97');
value_of(d.format('%Y')).should_be('1997');
//value_of(d.format('%z')).should_be('+0000');
if (Browser.Engine.trident) value_of(d.format('%Z')).should_be(new Date(Date.UTC()).get('timezone'));
if (global['Browser'] && Browser.ie) value_of(d.format('%Z')).should_be(new Date(Date.UTC()).get('timezone'));
else value_of(d.format('%Z')).should_be('GMT');
value_of(d.format('%y%')).should_be('97%');

Expand All @@ -305,7 +307,7 @@ describe('Date.format', {

value_of(d.format('rfc822')).should_be(d.format('%a') + ', ' + d.format('%d') + ' ' + d.format('%b') + ' ' + d.format('%Y') + ' ' + d.format('%H') + ':' + d.format('%M') + ':' + d.format('%S') + ' ' + d.format('%Z'));

if (Browser.Engine.trident) value_of(d.format('rfc822')).should_be('Thu, 20 Nov 1997 01:02:03 ' + new Date(Date.UTC()).get('timezone'));
if (global['Browser'] && Browser.ie) value_of(d.format('rfc822')).should_be('Thu, 20 Nov 1997 01:02:03 ' + new Date(Date.UTC()).get('timezone'));
else value_of(d.format('rfc822')).should_be('Thu, 20 Nov 1997 01:02:03 GMT');

value_of(d.format('short')).should_be(d.format('%d') + ' ' + d.format('%b') + ' ' + d.format('%H') + ':' + d.format('%M'));
Expand Down Expand Up @@ -429,3 +431,5 @@ describe('Date.parse', {
}

});

})(this);
10 changes: 6 additions & 4 deletions Specs/Configuration.js
Expand Up @@ -47,7 +47,8 @@ Configuration.sets = {
'Class/Chain.Wait',
'Types/Array.Extras', 'Types/Object.Extras',
'Types/String.Extras', 'Types/String.QueryString', 'Types/Number.Format',
'Types/Hash', 'Types/Hash.Extras', 'Locale/Locale',
'Types/Hash', 'Types/Hash.Extras', 'Types/Date',
'Types/Date.Extras', 'Locale/Locale',
'Utilities/Color', 'Utilities/Group'
]
},
Expand All @@ -58,7 +59,7 @@ Configuration.sets = {
'Class/Class.Occlude',
'Element/Element.Forms', 'Element/Element.Measure', 'Element/Elements.From', 'Element/Element.Shortcuts',
'Element/Element.Pseudos', 'Element/Element.Pseudos.Keys', 'Element/Element.Delegation',
'Types/Date.Extras', 'Types/Date', 'Types/URI', 'Types/URI.Relative',
'Types/URI', 'Types/URI.Relative',
'Interface/Keyboard',
'Request/Request.JSONP',
'Utilities/Hash.Cookie'
Expand Down Expand Up @@ -151,13 +152,16 @@ Configuration.source = {
'Types/Object.Extras',
'Types/Hash',
'Types/Hash.Extras',
'Types/Date',
'Types/Date.Extras',
'Types/String.Extras',
'Types/String.QueryString',

'Types/Number.Format',

'Utilities/Color',
'Utilities/Group'

]
},

Expand All @@ -174,8 +178,6 @@ Configuration.source = {
'Element/Element.Pseudos.Keys',
'Element/Element.Delegation',

'Types/Date',
'Types/Date.Extras',
'Types/URI',
'Types/URI.Relative',

Expand Down

0 comments on commit 9233d46

Please sign in to comment.