Back
parse-name (clj)
(source)function
(parse-name file-name)
Examples
migratus
(ns migratus.test.migrations
(:require
[clojure.test :refer [deftest is]]
[migratus.migration.sql :as sql-mig]
[migratus.migrations :as sut]
[migratus.properties :as props]
[migratus.utils :as utils]))
(deftest test-parse-name
(is (= ["20111202110600" "create-foo-table" ["up" "sql"]]
(sut/parse-name "20111202110600-create-foo-table.up.sql")))
(is (= ["20111202110600" "create-foo-table" ["down" "sql"]]
(sut/parse-name "20111202110600-create-foo-table.down.sql"))))
yogthos/migratus
(ns migratus.test.migrations
(:require
[clojure.test :refer [deftest is]]
[migratus.migration.sql :as sql-mig]
[migratus.migrations :as sut]
[migratus.properties :as props]
[migratus.utils :as utils]))
(deftest test-parse-name
(is (= ["20111202110600" "create-foo-table" ["up" "sql"]]
(sut/parse-name "20111202110600-create-foo-table.up.sql")))
(is (= ["20111202110600" "create-foo-table" ["down" "sql"]]
(sut/parse-name "20111202110600-create-foo-table.down.sql"))))