Permalink
Browse files

Removed path fn.

  • Loading branch information...
r0man committed Aug 4, 2012
1 parent 54879cc commit 0a89fc736f2a45f6cba0632e798d728cb43d9470
Showing with 1 addition and 24 deletions.
  1. +1 −10 src/clj/routes/helper.clj
  2. +0 −14 test/clj/routes/test/helper.clj
View
@@ -1,6 +1,6 @@
(ns routes.helper
(:refer-clojure :exclude [replace])
- (:require [clojure.string :refer [blank? join lower-case split replace replace-first]]
+ (:require [clojure.string :refer [blank? join split replace replace-first]]
[inflections.core :refer [parameterize]]
[inflections.number :refer [parse-integer]]
[routes.server :refer [*server* server-url]]))
@@ -25,15 +25,6 @@
"Register `route` by it's name."
[route] (swap! *routes* assoc (keyword (:name route)) route))
-(defn path
- "Make a path by joining `segments` with a slash."
- [& segments]
- (->> (map str segments)
- (remove blank?)
- (map #(replace %1 #"^/+" ""))
- (join "/")
- (str "/")))
-
(defn read-vector [s]
(->> (map #(keyword (replace %1 #"^:" ""))
(remove blank? (split (replace (str s) #"\[|\]" "") #"\s+")))
@@ -47,20 +47,6 @@
(register example-route)
(is (= example-route (route (:name example-route))))))
-(deftest test-path
- (are [segments expected]
- (is (= expected (apply path segments)))
- ["continents"]
- "/continents"
- ["/continents"]
- "/continents"
- ["//continents"]
- "/continents"
- ["continents" "eu-europe"]
- "/continents/eu-europe"
- ["/continents" "/eu-europe"]
- "/continents/eu-europe"))
-
(deftest test-parse-keys
(are [pattern expected]
(is (= expected (parse-keys pattern)))

0 comments on commit 0a89fc7

Please sign in to comment.