Test your shell scripts!
This repo itself is using shpec, so feel free to use it as an example. Here is the basic structure that you'll want:
└── shpec
└── an_example_shpec.sh
└── another_shpec.sh
Then to run your tests:
shpec [shpec_files]
shpec's own tests are a great place to start. More detailed examples to come.
The general format is:
assert matcher arguments
where matcher
is one of the following:
equal # equality
unequal # inequality
gt # algebraic '>'
lt # algebraic '<'
match # regex match
present # string presence
blank # string absence
file_present # file presence
file_absent # file absence
symlink # tests a symlink's target
test # evaluates a test string
Support for custom matchers coming soon.
sh -c "`curl https://raw.github.com/shpec/shpec/master/install.sh`"
Pull requests are always welcome.