@@ -13,32 +13,33 @@ describe('showfile', () => {
1313 . stdout ( )
1414 . command ( [ 'showfile' , 'test/resources/showfile.csv' ] )
1515 . it ( 'check 10 lines are found' , ctx => {
16- expect ( ctx . stdout ) . to . contain ( '|1 |2 |1 |14.0 |30.0708|1 |0 |' )
16+ expect ( ctx . stdout ) . to . contain ( '|1 |2 |1 |14.0 |30.0708|1 |0 |' )
1717 } )
1818 test
1919 . stdout ( )
2020 . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '5' ] )
2121 . it ( 'check 5th line is found' , ctx => {
22- expect ( ctx . stdout ) . to . contain ( '|0 |3 |0 |35.0|8.05 |0 |0 |' )
22+ expect ( ctx . stdout ) . to . contain ( '|0 |3 |0 |35.0|8.05 |0 |0 |' )
2323 } )
2424
2525 test
2626 . stdout ( )
27- . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '900' ] )
27+ . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '900' ] )
2828 . it ( 'check if the given number is greater than total lines' , ctx => {
29- expect ( ctx . stdout ) . to . contain ( '|0 |3 |0 |32.0 |7.75 |0 |0 |' )
29+ expect ( ctx . stdout ) . to . contain ( '|0 |3 |0 |32.0 |7.75 |0 |0 |' )
3030 } )
31+
3132 test
3233 . stdout ( )
3334 . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '900' ] )
3435 . it ( 'check if 900 count is used, it shows only total present rows' , ctx => {
3536 expect ( ctx . stdout ) . to . contain ( 'showing top 892 rows.' )
3637 } )
38+
3739 test
3840 . stdout ( )
3941 . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '0' ] )
40- . it ( 'check if the given number is greater than total lines' , ctx => {
41- expect ( ctx . stdout ) . to . contain ( '|Survived|Pclass|Sex|Age|Fare|Family_count|Cabin_ind |' )
42+ . it ( 'check if the given number is invalid then show default 10 lines' , ctx => {
43+ expect ( ctx . stdout ) . to . contain ( '|1 |2 |1 |14.0 |30.0708|1 |0 |' )
4244 } )
43- //|Survived|Pclass|Sex|Age|Fare|Family_count|Cabin_ind |
4445} )
0 commit comments