Commit 66065d7c authored by Giannis Kepas's avatar Giannis Kepas
Browse files

finish assignment 2 tests

parent 0395fa4f
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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'
}