From cabd726d18cf9b0b2666f7debe0b58f2973ae306 Mon Sep 17 00:00:00 2001 From: Dustin Getz Date: Sat, 5 Aug 2023 14:39:39 -0400 Subject: [PATCH] document :throws --- README.md | 3 +++ test/hyperfiddle/rcf/example_test.clj | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0c5f7b..9e8ae12 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,9 @@ Tests are run when you send a file or form to your Clojure/Script REPL. In Cursi (last xs) := :c (let [] (last xs) := :c)) + "exceptions" + (assert false "boom") :throws java.lang.AssertionError + (tests "nested tests (is there a strong use case?)" 1 := 1) diff --git a/test/hyperfiddle/rcf/example_test.clj b/test/hyperfiddle/rcf/example_test.clj index e779d5e..4c02276 100644 --- a/test/hyperfiddle/rcf/example_test.clj +++ b/test/hyperfiddle/rcf/example_test.clj @@ -71,8 +71,8 @@ (tests ":throws" - (let [e (ex-info "" {})] - (throw e) :throws clojure.lang.ExceptionInfo)) + (throw (ex-info "" {})) :throws clojure.lang.ExceptionInfo + (assert false "boom") :throws java.lang.AssertionError) (tests "missionary"