-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
35 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,5 +40,5 @@ | |
"type": "git", | ||
"url": "git://github.com/mout/mout.git" | ||
}, | ||
"version": "1.2.1" | ||
"version": "1.2.2" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "mout", | ||
"description": "Modular Utilities", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"homepage": "http://moutjs.com/", | ||
"author": "Miller Medeiros <[email protected]> (http://blog.millermedeiros.com)", | ||
"contributors": [ | ||
|
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 |
---|---|---|
@@ -1,37 +1,41 @@ | ||
define(['mout/array/repeat'], function (repeat) { | ||
|
||
describe('array/repeat()', function(){ | ||
describe('array/repeat()', function () { | ||
|
||
it('should create an array of size 0.', function(){ | ||
expect(repeat(0, 'a')).toEqual([]); | ||
}); | ||
it('should create an array of size 0.', function () { | ||
expect( repeat(0, 'a') ).toEqual([]); | ||
}); | ||
|
||
it('should create an array of size 1 and fill with null.', function(){ | ||
expect(repeat(1, null)).toEqual([null]); | ||
}); | ||
|
||
it('should create an array of size 1 and fill with a value "a".', function(){ | ||
expect(repeat(1, 'a')).toEqual(['a']); | ||
}); | ||
it('should create an array of size 1 and fill with null.', function () { | ||
expect( repeat(1, null) ).toEqual([null]); | ||
}); | ||
|
||
it('should create an array of size N and fill with a value "a".', function(){ | ||
expect(repeat(2, 'a')).toEqual(['a', 'a']); | ||
}); | ||
it('should create an array of size 1 and fill with a value "a".', function () { | ||
expect( repeat(1, 'a') ).toEqual(['a']); | ||
}); | ||
|
||
it('should create an array of size N and fill with values "albatros".', function(){ | ||
expect(repeat(2, 'albatros')).toEqual(['albatros', 'albatros']); | ||
}); | ||
it('should create an array of size N and fill with a value "a".', function () { | ||
expect( repeat(2, 'a') ).toEqual(['a', 'a']); | ||
}); | ||
|
||
it('should create an array of size N and fill with a number 1.', function(){ | ||
expect(repeat(2, 1)).toEqual([1, 1]); | ||
}); | ||
it('should create an array of size N and fill with array.', function () { | ||
expect( repeat(5, 'abc') ).toEqual(['abc', 'abc', 'abc', 'abc', 'abc']); | ||
}); | ||
|
||
it('should create an array of size N and fill with array.', function(){ | ||
expect(repeat(2, [1])).toEqual([[1], [1]]); | ||
}); | ||
it('should create an array of size N and fill with values "albatros".', function () { | ||
expect( repeat(2, 'albatros') ).toEqual(['albatros', 'albatros']); | ||
}); | ||
|
||
it('should create an array of size N and fill with a number 1.', function () { | ||
expect( repeat(2, 1) ).toEqual([1, 1]); | ||
}); | ||
|
||
it('should create an array of size N and fill with array.', function () { | ||
expect( repeat(2, [1]) ).toEqual([[1], [1]]); | ||
}); | ||
|
||
it('should throw an exception in case the of a negative number.', function(){ | ||
expect(() => repeat(-1, null)).toThrow(); | ||
it('should throw an exception in case the of a negative number.', function () { | ||
expect( function () { repeat(-1, null) } ).toThrow(); | ||
}); | ||
}); | ||
}); | ||
}); |