Loading tests/assignment-2/a2-task2.bats +20 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,23 @@ setup() { load '../../bats/bats-support/load' load '../../bats/bats-assert/load' } @test "[TASK 2] test 1: should print 'is a file' for argument 'task-2.sh'" { run ./task-2.sh "task-2.sh" assert_output --partial 'file' } @test "[TASK 2] test 2: should print 'is a directory' for argument 'os-tests'" { run ./task-2.sh "os-tests" assert_output --partial 'directory' } @test "[TASK 2] test 3: should print 'There is no such file or directory' for argument 'abcdefg.hello'" { run ./task-2.sh "abcdefg.hello" assert_output --partial 'no such file or directory' } @test "[TASK 2] test 4: should print 'Invalid number of parameters' for arguments 'task-2.sh' and 'task-2.sh'" { run ./task-2.sh "task-2.sh" "task-2.sh" assert_output --partial 'Invalid number of parameters' } Loading
tests/assignment-2/a2-task2.bats +20 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,23 @@ setup() { load '../../bats/bats-support/load' load '../../bats/bats-assert/load' } @test "[TASK 2] test 1: should print 'is a file' for argument 'task-2.sh'" { run ./task-2.sh "task-2.sh" assert_output --partial 'file' } @test "[TASK 2] test 2: should print 'is a directory' for argument 'os-tests'" { run ./task-2.sh "os-tests" assert_output --partial 'directory' } @test "[TASK 2] test 3: should print 'There is no such file or directory' for argument 'abcdefg.hello'" { run ./task-2.sh "abcdefg.hello" assert_output --partial 'no such file or directory' } @test "[TASK 2] test 4: should print 'Invalid number of parameters' for arguments 'task-2.sh' and 'task-2.sh'" { run ./task-2.sh "task-2.sh" "task-2.sh" assert_output --partial 'Invalid number of parameters' }