Skip to content

Commit 7bcd6b3

Browse files
committed
Release 0.3.0.
1 parent 6b9e726 commit 7bcd6b3

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Bond [![CircleCI Status](https://circleci.com/gh/circleci/bond.png?style=badge)]
44
Bond is a spying and stubbing library, primarily intended for tests.
55

66
```clojure
7-
8-
[circleci/bond "0.2.12"]
7+
[circleci/bond "0.3.0"]
98
```
109

1110
```clojure
@@ -30,29 +29,29 @@ Bond also provides `with-stub!`. It works the same as `with-spy`, but redefines
3029

3130
```clojure
3231
(ns test.foo
33-
(:require [bond.james :as bond :refer [with-stub]))
32+
(:require [bond.james :as bond :refer [with-stub!]))
3433

3534
(defn foo [x] ...)
3635

3736
(defn bar [y] ...)
3837

3938
(deftest foo-is-called
40-
(with-stub [[foo (fn [x] "foo")]
41-
[bar (fn [y] "bar")]]
39+
(with-stub! [[foo (fn [x] "foo")]
40+
[bar (fn [y] "bar")]]
4241
(is (= ["foo" "bar"] [(foo 1) (bar 2)]))))
4342

4443
(deftest consecutive-stubbing
45-
(with-stub [[foo [(fn [x] "foo1")
46-
(fn [x] "foo2")
47-
(fn [x] "foo3")]]
48-
[bar (fn [y] "bar")]]
44+
(with-stub! [[foo [(fn [x] "foo1")
45+
(fn [x] "foo2")
46+
(fn [x] "foo3")]]
47+
[bar (fn [y] "bar")]]
4948
(is (= ["foo1" "foo2" "foo3" "bar"] [(foo 1) (foo 1) (foo 1) (bar 2)]))))
5049

5150
```
5251

5352
There is also a `with-stub` macro which works like `with-stub!` but omits the argument check.
5453

55-
In addition to `with-spy` and `with-stub`, Bond also provides `with-spy-ns`
54+
In addition to `with-spy` and `with-stub!`, Bond also provides `with-spy-ns`
5655
and `with-stub-ns` which can spy/stub every function in a namespace in one go:
5756

5857
```clojure

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject circleci/bond "0.2.12"
1+
(defproject circleci/bond "0.3.0"
22
:description "Spying library for testing"
33
:license {:name "Eclipse Public License"
44
:url "http://www.eclipse.org/legal/epl-v10.html"}

0 commit comments

Comments
 (0)