@@ -13,32 +13,33 @@ describe('showfile', () => {
13
13
. stdout ( )
14
14
. command ( [ 'showfile' , 'test/resources/showfile.csv' ] )
15
15
. 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 |' )
17
17
} )
18
18
test
19
19
. stdout ( )
20
20
. command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '5' ] )
21
21
. 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 |' )
23
23
} )
24
24
25
25
test
26
26
. stdout ( )
27
- . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '900' ] )
27
+ . command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '900' ] )
28
28
. 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 |' )
30
30
} )
31
+
31
32
test
32
33
. stdout ( )
33
34
. command ( [ 'showfile' , 'test/resources/showfile.csv' , '-n' , '900' ] )
34
35
. it ( 'check if 900 count is used, it shows only total present rows' , ctx => {
35
36
expect ( ctx . stdout ) . to . contain ( 'showing top 892 rows.' )
36
37
} )
38
+
37
39
test
38
40
. stdout ( )
39
41
. 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 |' )
42
44
} )
43
- //|Survived|Pclass|Sex|Age|Fare|Family_count|Cabin_ind |
44
45
} )
0 commit comments