Permalink
Browse files

Add custom matchers to README

- Closes #14
  • Loading branch information...
1 parent aec1ad6 commit ced056cb7d5638f17a3d52cbe4c9791c9e1765a5 @rylnd committed Feb 19, 2013
Showing with 22 additions and 1 deletion.
  1. +22 −1 README.md
View
@@ -50,7 +50,28 @@ symlink # tests a symlink's target
test # evaluates a test string
```
-Support for custom matchers coming soon.
+#### Custom Matchers
+Custom matchers are loaded from `shpec/matchers/*.sh`.
+
+For example, here's how you'd create a `still_alive` matcher:
+
+```bash
+# in shpec/matchers/network.sh
+still_alive() {
+ ping -oc1 "$1" > /dev/null 2>&1
+ assert equal "$?" 0
+}
+```
+
+Then you can use that matcher like any other:
+
+```bash
+# in shpec/network_shpec.sh
+describe "my server"
+ it "serves responses"
+ assert still_alive "my-site.com"
+end_describe
+```
## Installation
```bash

0 comments on commit ced056c

Please sign in to comment.