slagyr/speclj — pull request #76 by mylesmegyesi (2014-01-14 17:37:37+00:00)
Title: Nested stubs and more granular expectations on stubs

This PR addresses the following use cases:

Granular expectations

```clojure
(let [f (stub :the-stub)]
(f :one :two)
(f :three :four)
(should-have-invoked :the-stub {:with [:one :two]})
(should-have-invoked :the-stub {:with [:three :four]}))
```

Nested stubs

```clojure
(it "allows for nested should-invoke's"
(should-pass!
(should-invoke reverse {:times 1}
(should-invoke println {:times 1}
(println "hello!")
(reverse [1 2])))))
```

This offers a backwards compatible implementation that allows nesting multiple should-invokes. GH-74 tries to accomplish the same thing but unfortunately changes the API of should-invoke.