Merge pull request #11 from hankyates/array-of-tests

* hankyates/array-of-tests:
  Adding Array#of tests
This commit is contained in:
Brian Terlson 2014-07-16 17:05:16 -07:00
commit 382b844b23
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,22 @@
// Copyright (c) 2014 Hank Yates. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
//
/**
* @description Testing Array#of when passed Strings
* @author Hank Yates (hankyates@gmail.com)
*/
runTestCase(function () {
var testArr = Array.of('testString', 'anotherTestString');
if (testArr[0] !== 'testString') {
return false;
}
if (testArr[1] !== 'anotherTestString') {
return false;
}
return true;
});

View File

@ -0,0 +1,21 @@
// Copyright (c) 2014 Hank Yates. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @description Testing Array#of when passed single argument
* @author Hank Yates (hankyates@gmail.com)
*/
runTestCase(function () {
var testArr = Array.of(3);
if (testArr.length !== 1) {
return false;
}
if (testArr[0] !== 3) {
return false;
}
return true;
});