From f929918c21525b943b4fafa5746419a383fbefa2 Mon Sep 17 00:00:00 2001 From: AntonKarabaza Date: Wed, 11 Oct 2017 16:13:17 +0300 Subject: [PATCH] Add whitespace configuration tests #58 --- src/test/git-elegant-configure.bats | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/test/git-elegant-configure.bats b/src/test/git-elegant-configure.bats index a3f49e6..55d8016 100644 --- a/src/test/git-elegant-configure.bats +++ b/src/test/git-elegant-configure.bats @@ -4,16 +4,19 @@ load commons load fake-read setup() { - fake-pass git "config --global core.commentChar" "|" - fake-pass git "config --local core.commentChar" "|" - fake-pass git "config --global user.name" "UserName" fake-pass git "config --global user.email" "UserEmail" + fake-pass git "config --global core.commentChar" + fake-pass git "config --local core.commentChar" + fake-pass git "config --global user.name UserName" fake-pass git "config --global user.email UserEmail" fake-pass git "config --local user.name UserName" fake-pass git "config --local user.email UserEmail" + + fake-pass git "config --global apply.whitespace fix" + fake-pass git "config --local apply.whitespace fix" } @test "'configure': exit code is 11 when run without arguments" { @@ -34,16 +37,18 @@ setup() { @test "'configure': sequence of the configuration is correct when run with '--global' argument" { run git-elegant configure --global - [[ "${lines[0]}" =~ "commit message won't start with [|]:" ]] - [[ "${lines[1]}" =~ "your user name [UserName]:" ]] - [[ "${lines[2]}" =~ "your user email [UserEmail]:" ]] - [ ${#lines[@]} == 3 ] + [ "${lines[0]}" = "commit message won't start with [|]: " ] + [ "${lines[1]}" = "your user name [UserName]: " ] + [ "${lines[2]}" = "your user email [UserEmail]: " ] + [ "${lines[3]}" = "whitespace issues on patching [fix]: " ] + [ ${#lines[@]} -eq 4 ] } @test "'configure': sequence of the configuration is correct when run with '--local' argument" { run git-elegant configure --local - [[ "${lines[0]}" =~ "commit message won't start with [|]:" ]] - [[ "${lines[1]}" =~ "your user name [UserName]:" ]] - [[ "${lines[2]}" =~ "your user email [UserEmail]:" ]] - [ ${#lines[@]} == 3 ] + [ "${lines[0]}" = "commit message won't start with [|]: " ] + [ "${lines[1]}" = "your user name [UserName]: " ] + [ "${lines[2]}" = "your user email [UserEmail]: " ] + [ "${lines[3]}" = "whitespace issues on patching [fix]: " ] + [ ${#lines[@]} -eq 4 ] }