Skip to content

Assertions are referred to as tests in cider-test #1627

@bbatsov

Description

@bbatsov

I've noticed that in our messages we never use the term assertion, which is what lein uses extensively. I mean tests are composed of assertions:

(deftest error-handling-test
  (testing "Handles a fake error done via mocked function"
    (with-redefs [cider.nrepl.middleware.apropos/find-symbols
                  (fn [& args] (throw (Exception. "boom")))]
      (let [response (session/message {:op "apropos" :query "doesn't matter"})]
        (is (= (:status response) #{"apropos-error" "done"}))
        (is (= (:ex response) "class java.lang.Exception"))
        (is (.startsWith (:err response) "java.lang.Exception: boom")))))

  (testing "Handles a real error caused by an improper regular expression"
    (let [response (session/message {:op "apropos" :query "*illegal"})]
      (is (= (:status response) #{"apropos-regexp-error" "done"}))
      (is (.startsWith (:error-msg response) "Dangling")))))

This is one test with 5 assertions (is) in it. However, our message right now is:

cider.nrepl.middleware.apropos-test: Ran 5 tests. 0 failures, 0 errors.

It should be

cider.nrepl.middleware.apropos-test: Ran 1 test, 5 assertions. 0 failures, 0 errors.

@jeffvalk Was there a particular reason you avoided the term assertion?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions