我想在每个规范之前启动一项服务,并在每个规范之后关闭它。同时我希望每个规范都能够使用service
规范中的。例如(这不起作用):
(describe
"Something"
(around [it]
(let [service (start!)]
(try
(it)
(finally
(shutdown! service)))))
(it "is true"
; Here I'd like to use the "service" that was started in the around tag
(println service)
(should true))
(it "is not false"
(should-not false)))
我怎样才能做到这一点?