diff --git a/test/git-check-assertions.bats b/test/git-check-assertions.bats index 2e45490..1755820 100755 --- a/test/git-check-assertions.bats +++ b/test/git-check-assertions.bats @@ -99,6 +99,16 @@ commit_with_assertion() { assert_size_zero ../test } +@test "should restore worktree after a failure" { + git checkout -b feature + commit_with_assertion $'echo blah >> readme\nexit 3' + + run git-check-assertions + + assert_failure + assert_size_zero readme +} + @test "assertions should run against the version of the code inside of the commit" { git checkout -b feature echo commit1 >readme