|
1 | 1 | import {expect, test} from '@oclif/test' |
2 | 2 |
|
3 | | -describe('showfile', () => { |
| 3 | +describe('view', () => { |
4 | 4 | test |
5 | 5 | .stdout() |
6 | | - .command(['showfile']) |
| 6 | + .command(['view']) |
7 | 7 | .exit(0) |
8 | 8 | .it('File path not passed', ctx => { |
9 | 9 | expect(ctx.stdout).to.contain('File path not passed') |
10 | 10 | }) |
11 | 11 |
|
12 | 12 | test |
13 | 13 | .stdout() |
14 | | - .command(['showfile', 'test/resources/showfile.csv']) |
| 14 | + .command(['view', 'test/resources/csv/test_view.csv']) |
15 | 15 | .it('check 10 lines are found', ctx => { |
16 | 16 | expect(ctx.stdout).to.contain('|1 |2 |1 |14.0 |30.0708|1 |0 |') |
17 | 17 | }) |
18 | 18 | test |
19 | 19 | .stdout() |
20 | | - .command(['showfile', 'test/resources/showfile.csv', '-n', '5']) |
| 20 | + .command(['view', 'test/resources/csv/test_view.csv', '-n', '5']) |
21 | 21 | .it('check 5th line is found', ctx => { |
22 | 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 (['view', 'test/resources/csv/test_view.csv', '-n', '900']) |
28 | 28 | .it('check if the given number is greater than total lines', ctx => { |
29 | 29 | expect(ctx.stdout).to.contain('|0 |3 |0 |32.0 |7.75 |0 |0 |') |
30 | 30 | }) |
31 | 31 |
|
32 | 32 | test |
33 | 33 | .stdout() |
34 | | - .command(['showfile', 'test/resources/showfile.csv', '-n', '900']) |
| 34 | + .command(['view', 'test/resources/csv/test_view.csv', '-n', '900']) |
35 | 35 | .it('check if 900 count is used, it shows only total present rows', ctx => { |
36 | 36 | expect(ctx.stdout).to.contain('showing top 892 rows.') |
37 | 37 | }) |
38 | 38 |
|
39 | 39 | test |
40 | 40 | .stdout() |
41 | | - .command(['showfile', 'test/resources/showfile.csv', '-n', '0']) |
| 41 | + .command(['view', 'test/resources/csv/test_view.csv', '-n', '0']) |
42 | 42 | .it('check if the given number is invalid then show default 10 lines', ctx => { |
43 | 43 | expect(ctx.stdout).to.contain('|1 |2 |1 |14.0 |30.0708|1 |0 |') |
44 | 44 | }) |
|
0 commit comments