The instructions in HELP.md include a description to run the exercise’s test using the REPL. When using lein repl
to start the REPL, these instructions are fine. But starting the REPL with just clj
followed by requiring the exercise’s test namespace, e.g. (require 'hello-world-test)
results in this error message:
Execution error (FileNotFoundException) at user/eval1 (REPL:1).
Could not locate hello_world_test__init.class, hello_world_test.clj or hello_world_test.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
You’re right, it does fail to require the namespace when using the clj command. That said, I don’t see much sense in using this kind of workflow just to run the tests. Using clj -X:test will run the tests immediately. Loading the REPL only makes sense if someone wants to take advantage of the extra functionality it provides.
I’ve posted a short guide here in case you want to go that route:
For further help, please refer to the documentation here:
I’ll submit a PR later, I’ll most likely remove the REPL section from the help.md file.
thanks for confirmation and your future PR!
I don’t care much for the REPL section in that help file, too. But since it was there, you know, it’s just like one of those big buttons saying Don’t push me: who can resist pushing it?!
I found out about your short guide before, BUT it only seems to work for the source files in the src subdirectory; not for the test files in the test subdirectory.
(At least on my computers).