Looks cool. It would be nice if it had some realistic example. I don't really understand what the describe Truth thing does.
I appreciate the effort to get this working under ClojureCLR.
@didibus the example only shows how a couple of the assertions can be used, should and should-not.
The output in the example would look something like this:
Truth
- is true
- is not false
Finished in 0.00131 seconds
2 examples, 0 failures
We could negate the assertions:
; sample.core-spec
(it "is true"
(should false))
(it "is not false"
(should-not true))
; out
Truth
- is true (FAILED)
- is not false (FAILED)
Failures:
1) Truth is true
Expected truthy but was: false
sample/core_spec
2) Truth is not false
Expected falsy but was: true
sample/core_spec
Finished in 0.00088 seconds
2 examples, 2 failures
There are tons of other assertions like should= and should-throw, which would work like this:
; sample.core-spec
(it "divides some numbers"
(should= 5 (/ 15 3))
(should-throw (/ 1 0)))
; out
Truth
- divides some numbers
Finished in 0.00094 seconds
1 examples, 0 failuresI think I mean, showing a test that appears to test true doesn't let me imagine how I'd benefit from this style of testing to test my actual application features.
It's mostly cause I'm not familiar with RSpec I think. But I feel showing an example of like, how would you test a fib function? Or do you expect like one spec per namespace, or one spec per function?
Ah, I see. Well as far as organizing specs go, they must be in a /spec directory and the namespace must end with _spec. Other than that, itβs really up to you how you want to organize your project π
Speclj is self-referencing; the tests for speclj are written using speclj, so you can certainly use that as an example. All of https://github.com/cleancoders/c3kit is also tested using speclj, so you can use those as examples as well.
Typically, we do one spec per namespace. So acme.foo would have a corresponding acme.foo-spec namespace. Helper namespaces, however, will sometimes just be tested implicitly by tests against acme.foo. So acme.helper may not necessarily have a corresponding acme.helper-spec namespace.
When AOT to dlls?
If you are interested in the problems of getting AOT to work in ClojureCLR on .NET 9, I did a little writeup https://dmiller.github.io/clojure-clr-next/general/2025/02/20/AOT-compilation-issues.html If you have thoughts, I created a discussion https://github.com/dmiller/clojure-clr-next/discussions/8 .
Next on the list after getting 1.12 beta out.