Permalink
Browse files

fix prefix-based looukp for namespaces with dashes

  • Loading branch information...
1 parent 260dc44 commit 00fef412f2f94a4f35dbc0f4ca44ee5e759ce2e2 @anttipoi anttipoi committed Mar 18, 2012
Showing with 9 additions and 2 deletions.
  1. +3 −1 src/bultitude/core.clj
  2. +1 −0 test/bulti_tude/test.clj
  3. +5 −1 test/bultitude/core_test.clj
View
4 src/bultitude/core.clj
@@ -91,7 +91,9 @@
(cond
(.isDirectory f) (namespaces-in-dir
(if prefix
- (io/file f (.replaceAll prefix "\\." "/"))
+ (io/file f (-> prefix
+ (.replaceAll "\\." "/")
+ (.replaceAll "-" "_")))
f))
(jar? f) (let [ns-list (namespaces-in-jar f)]
(if prefix
View
1 test/bulti_tude/test.clj
@@ -0,0 +1 @@
+(ns bulti-tude.test)
View
6 test/bultitude/core_test.clj
@@ -17,4 +17,8 @@
(testing "directory"
(is (=
#{'bultitude.core 'bultitude.core-test}
- (set (namespaces-on-classpath :prefix "bultitude"))))))
+ (set (namespaces-on-classpath :prefix "bultitude")))))
+ (testing "dash handling in prefixes"
+ (is (=
+ #{'bulti-tude.test}
+ (set (namespaces-on-classpath :prefix "bulti-tude"))))))

0 comments on commit 00fef41

Please sign in to comment.