Requisite that streams one throwable and one non-throwable?

4 views
Skip to first unread message

Barry Wark

unread,
Mar 24, 2015, 10:57:38 PM3/24/15
to mi...@googlegroups.com
I would like to check a fact such as 

(fact "`my-fn` handles throw exceptions on first call to `might-throw`"
  (my-fn "foo") => "bar"
  (provided
    (might-throw "foo") =streams=> [(Exception.) "bar"])))

I know that I could use

(fact "`my-fn` handles throw exceptions on first call to `might-throw`"
  (my-fn "foo") => "bar"
  (provided
    (might-throw "foo") =throws=> (Exception.)))

for the first throwable, and =streams=> for multiple return values, but can't find a way to combine these. 

When there isn't a good way in Midje, I suspect I'm on the wrong path. What's a better way to proceed?

Thanks,
Barry
Reply all
Reply to author
Forward
0 new messages