Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Add tests for utils/uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
migerh committed Feb 9, 2016
1 parent c8a04a8 commit 70c23a7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 50 deletions.
49 changes: 0 additions & 49 deletions test/testUuid.js

This file was deleted.

2 changes: 1 addition & 1 deletion tests/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ define({
//'tests/unit/utils/event',
//'tests/unit/utils/expect',
'tests/unit/utils/type',
//'tests/unit/utils/uuid',
'tests/unit/utils/uuid',
//'tests/unit/utils/xml',
//'tests/unit/utils/zip',
],
Expand Down
41 changes: 41 additions & 0 deletions tests/unit/utils/uuid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
define([
'intern!object',
'intern/chai!assert',
'utils/uuid'
], function (registerSuite, assert, UUID) {
registerSuite({
genUUID_NoInput_ReturnsString: function () {
var result;

result = UUID.genUUID();

assert.isString(result);
},

genUUID_NoInput_ReturnsOnlyAlphaNumericAndDash: function () {
var result;

result = UUID.genUUID();

assert(/^[a-zA-Z0-9\-]+$/.test(result));
},

genUUID_NoInput_ResultIs36CharsLong: function () {
var expectedLength = 36,
result;

result = UUID.genUUID();

assert.equal(result.length, expectedLength);
},

genUUID_TwoCalls_DifferentResults: function () {
var result1, result2;

result1 = UUID.genUUID();
result2 = UUID.genUUID();

assert.notEqual(result1, result2);
}
});
});

0 comments on commit 70c23a7

Please sign in to comment.