@@ -7,32 +7,32 @@ QUnit.test( "test if words are counted correctly", function( assert ) {
77} ) ;
88
99QUnit . test ( "find the longest word" , function ( assert ) {
10- var wordsUtility = new WordsUtility ( "ola yeah yoyoyo yoda" ) ;
11- assert . equal ( wordsUtility . longestWord ( ) , "yoyoyo " ) ;
10+ var wordsUtility = new WordsUtility ( theWords ) ;
11+ assert . equal ( wordsUtility . longestWord ( ) , "dependencies " ) ;
1212} ) ;
1313
1414QUnit . test ( "the average word length of words supplied" , function ( assert ) {
15- var wordsUtility = new WordsUtility ( "ola yeah yoyoyo" ) ;
16- assert . equal ( wordsUtility . averageWordLength ( ) , "ola" ) ;
15+ var wordsUtility = new WordsUtility ( theWords ) ;
16+ assert . equal ( wordsUtility . averageWordLength ( ) , 5.585365853658536 ) ;
1717} ) ;
1818
1919QUnit . test ( "find words with the same length" , function ( assert ) {
20-
21- var wordsUtility = new WordsUtility ( "ola yeah yoyoyo yoda" ) ;
22- var words = wordsUtility . wordsWithTheSameLength ( ) ;
20+ var wordsUtility = new WordsUtility ( theWords ) ;
21+ var words = wordsUtility . wordsWithTheSameLength ( ) ;
22+ assert . deepEqual ( words , [ "Unit" , "Test" , "code" , "that" , "your" , "some" , "that" , "work" , "way." , "Unit" , "from" , "will" , "Unit" ] )
2323} ) ;
2424
2525
2626QUnit . test ( "no words with the same length return nothing" , function ( assert ) {
27- var wordsUtility = new WordsUtility ( "ola yeah yoyoyo yoda" ) ;
27+ var wordsUtility = new WordsUtility ( theWords ) ;
2828
29- assert . equal ( 0 , wordsUtility . wordsWithTheSameLength ( ) . length ) ;
29+ assert . equal ( 9 , wordsUtility . noWordsWithTheSameLength ( ) . length ) ;
3030
3131} ) ;
3232
3333QUnit . test ( "find the shortest word" , function ( assert ) {
34- var wordsUtility = new WordsUtility ( "ola yeah yoyoyo" ) ;
35- assert . equal ( wordsUtility . shortestWord ( ) , "ola " ) ;
34+ var wordsUtility = new WordsUtility ( theWords ) ;
35+ assert . equal ( wordsUtility . shortestWord ( ) , "A " ) ;
3636} ) ;
3737
3838QUnit . jUnitReport = function ( report ) {
0 commit comments