File: commit-msg.bats

package info (click to toggle)
git-secrets 1.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 256 kB
  • sloc: sh: 996; makefile: 27
file content (18 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bats
load test_helper

@test "Rejects commit messages with prohibited patterns" {
  setup_good_repo
  repo_run git-secrets --install $TEST_REPO
  run git commit -m '@todo in the message??'
  [ $status -eq 1 ]
  [ "${lines[0]}" == ".git/COMMIT_EDITMSG:1:@todo in the message??" ]
}

@test "Allows commit messages that do not match a prohibited pattern" {
  setup_good_repo
  repo_run git-secrets --install $TEST_REPO
  cd $TEST_REPO
  run git commit -m 'This is OK'
  [ $status -eq 0 ]
}