From 395e9eff3c3f09ea16dd5d35684593723c604d6a Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Tue, 17 Oct 2017 07:43:58 +0200 Subject: [PATCH] Added a couple more tests for mkcd Also fixed the order of expected/actual for lsgrep test. --- test/plugins/base.plugin.bats | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/plugins/base.plugin.bats b/test/plugins/base.plugin.bats index 5d887502..3988831f 100755 --- a/test/plugins/base.plugin.bats +++ b/test/plugins/base.plugin.bats @@ -36,8 +36,15 @@ load ../../plugins/available/base.plugin @test 'plugins base: mkcd()' { cd "${BASH_IT_ROOT}" - run mkcd -dir_with_dash + declare -r dir_name="-dir_with_dash" + + # Make sure that the directory does not exist prior to the test + rm -rf "${BASH_IT_ROOT}/${dir_name}" + + mkcd "${dir_name}" assert_success + assert_file_exist "${BASH_IT_ROOT}/${dir_name}" + assert_equal $(pwd) "${BASH_IT_ROOT}/${dir_name}" } @test 'plugins base: lsgrep()' { @@ -45,7 +52,7 @@ load ../../plugins/available/base.plugin cd $BASH_IT_TEST_DIR run lsgrep 2 assert_success - assert_equal 2 $output + assert_equal $output 2 } @test 'plugins base: buf()' {