Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaycfields committed Jan 10, 2013
1 parent 8200c55 commit c871dd2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,32 @@ expectations is a minimalist's testing framework

----------

## 10 second example (inferred testing demo)

```clojure
;; use expectations to test equality
(expect 1 1)
(expect "foo" "foo")

;; test if the regex is in a string
(expect #"foo" "boofooar")

;; does the form throw an expeted exception
(expect ArithmeticException (/ 12 0))

;; expect a k/v pair in map. used for verifying subset k/v pairs
(expect {:foo 1} (in {:foo 1 :cat 4}))

;; key in set
(expect :foo (in #{:foo :bar}))

;; val in list
(expect :foo (in [:bar :foo]))

;; expect a function to return a truthy value give the actual argument
(expect empty? (list))
```

## Credit

Expectations is based on clojure.test. clojure.test is distributed under the Eclipse license, with
Expand Down

0 comments on commit c871dd2

Please sign in to comment.