slagyr / speclj

pronounced "speckle": a TDD/BDD framework for Clojure.
MIT License
459 stars 58 forks source link

Support for `*.cljc` files in vigilant mode? #131

Closed Jell closed 9 years ago

Jell commented 9 years ago

*.cljc files are not being watched or reloaded when working with both Clojure and ClojureScript.

With the release of clojure 1.7 around the corner, it would be nice to support those as they will be part of the core language.

I've opened a corresponding request to the underlying "fresh" library here: https://github.com/slagyr/fresh/issues/2

slagyr commented 9 years ago

Yeah... that's annoying, huh? At least it was for me. Version 3.3.0 (soon to be released) fixes this.

Jell commented 9 years ago

Thanks a bunch! :)

milt commented 9 years ago

Still seeing this with 3.3.0, but perhaps I am doing something wrong. When I try running lein spec -a with a core_spec.cljc like this:

(ns my-project.core-spec
  #?(:cljs
     (:require-macros
      [speclj.core :refer [describe it should run-specs]]))
  (:require
   #?@(:cljs [[speclj.core]]
       :clj [[speclj.core :refer :all]])))

(describe "foo"
          (it "does stuff"
              (should true)))

(run-specs)

It will give me this:

----- Mon Jun 22 12:44:35 EDT 2015 -------------------------------------------------------------------
took 0.12333 to determine file statuses.
reloading files:
  /Users/milt/projects/my-project/spec/my_project/core_spec.cljc

...but not run the tests. lein spec works as expected. Changes to the file will get it to reload, but the test still doesn't run.

slagyr commented 9 years ago

A little bit of researching revealed that reader conditionals must be enabled when you call clojure.core/read. Speclj has been updated to do this. Checkout 3.3.1.

milt commented 9 years ago

Oh wow, that helps me elsewhere too. You are awesome!