Skip to content

Commit 6068eb9

Browse files
committed
add shellspec
1 parent 18de8ed commit 6068eb9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.shellspec

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--require spec_helper
2+
3+
## Default kcov (coverage) options
4+
# --kcov-options "--include-path=. --path-strip-level=1"
5+
# --kcov-options "--include-pattern=.sh"
6+
# --kcov-options "--exclude-pattern=/.shellspec,/spec/,/coverage/,/report/"
7+
8+
## Example: Include script "myprog" with no extension
9+
# --kcov-options "--include-pattern=.sh,myprog"
10+
11+
## Example: Only specified files/directories
12+
# --kcov-options "--include-pattern=myprog,/lib/"

spec/spec_helper.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# shellcheck shell=sh
2+
3+
# Defining variables and functions here will affect all specfiles.
4+
# Change shell options inside a function may cause different behavior,
5+
# so it is better to set them here.
6+
# set -eu
7+
8+
# This callback function will be invoked only once before loading specfiles.
9+
spec_helper_precheck() {
10+
# Available functions: info, warn, error, abort, setenv, unsetenv
11+
# Available variables: VERSION, SHELL_TYPE, SHELL_VERSION
12+
: minimum_version "0.28.1"
13+
}
14+
15+
# This callback function will be invoked after a specfile has been loaded.
16+
spec_helper_loaded() {
17+
:
18+
}
19+
20+
# This callback function will be invoked after core modules has been loaded.
21+
spec_helper_configure() {
22+
# Available functions: import, before_each, after_each, before_all, after_all
23+
: import 'support/custom_matcher'
24+
}

0 commit comments

Comments
 (0)