Error when using autotest option

61 views
Skip to first unread message

Caleb

unread,
Feb 23, 2011, 1:27:29 PM2/23/11
to speclj
I am getting the following error when I try to run speclj in autotest
mode:

> java -cp `lein classpath` speclj.main -a

----- Wed Feb 23 12:22:29 CST 2011
-------------------------------------------------------------------
took 0.01930 seconds to determine which files to reload.
reloading files:
/Users/cphillip/Projects/practice/clojure-string-calculator/spec/
clojure_string_calculator/core_spec.clj
java.io.FileNotFoundException: Could not locate
clojure_string_calculator/core_spec__init.class or
clojure_string_calculator/core_spec.clj on classpath:
... 37 stack levels elided ...

Running without the autotest option works fine:

> java -cp `lein classpath` speclj.main
............

Finished in 0.00663 seconds

12 examples, 0 failures

"lein spec" also works fine.

Is there something I am missing here?

Thanks alot,
Caleb

Micah Martin

unread,
Feb 23, 2011, 2:13:14 PM2/23/11
to spe...@googlegroups.com
Caleb,

I'm gonna take a shot in the dark here. Do you have the following included in your project.clj?

:test-path "spec/"

The standard runner loads all the specs in the spec dir. The autotest runner, due to the discovery nature, has to load specs from the class path. Without the above config, the spec dir won't be in the classpath.

Let me know if that doesn't help.

Micah

Caleb

unread,
Feb 24, 2011, 9:40:09 AM2/24/11
to speclj
Micah,
That was an excellent shot in the dark. I had a typo in my project
file (:testpath "spec/" instead of :test-path "spec/").

BTW, the autotest feature is a huge help to me. I am developing the
steps for the string calculator kata and waiting several seconds for
the tests to run was really interrupting the flow.

Thanks for the quick response,
Caleb

Micah Martin

unread,
Feb 24, 2011, 11:15:35 AM2/24/11
to spe...@googlegroups.com
Caleb,

Great. Glad I could help.

Yeah, I find it hard to believe I lived without autotest in the past. Now when I code in Ruby or Java, I'm frustrated every time I need to manually run the tests. How primitive! I need to checkout the Ruby's autotest.

Micah

Caleb

unread,
Feb 24, 2011, 12:03:51 PM2/24/11
to speclj
Corey Haines' ruby string calculator video convinced me to try
autotest. The integration with growl is especially nice because you
can quickly see red or green without reading any text. I definitely
feel like the less interruption running the tests causes, the more
likely I am to develop the "shape" of the algorithm in incremental
steps, instead of trying to generalize too early to "save time".

Caleb



On Feb 24, 10:15 am, Micah Martin <micahmar...@gmail.com> wrote:
> Caleb,
>

Micah Elliott

unread,
Jul 31, 2012, 10:29:08 PM7/31/12
to spe...@googlegroups.com
Hi guys -- I just hit the same problem. I actually do have :test-path set correctly though, and I've tried setting it to "spec", "spec/", and other variations. I finally found the :test-paths (plural) vector option (as used in speclj itself) and it is working fine (with ["spec"]), so I have a satisfactory undocumented workaround.

I also commented out the :test-paths line in speclj's project.clj and I see that it breaks in the same way as my "sample" project.

Thanks for Speclj. It seems to be the only lein2-capable autotest option among the whole slew of test tools.

--
Another Micah :)

Micah Martin

unread,
Aug 1, 2012, 6:40:54 AM8/1/12
to spe...@googlegroups.com
Other Micah,

Thanks!  I pushed another fix to README.  I'm glad to hear Speclj is serving you well.

This Micah
Reply all
Reply to author
Forward
0 new messages