Skip to content

Commit

Permalink
test case for name transform and enabled lazytest for midje
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeu committed Oct 13, 2012
1 parent 48d53ce commit bb3da18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion project.clj
Expand Up @@ -7,4 +7,6 @@
:plugins [[lein-midje "2.0.0-SNAPSHOT"]
[lein-swank "1.4.4"]]
:profiles {:dev {:resources-path "test-templates"
:dependencies [[midje "1.4.0"]]}})
:dependencies [[midje "1.4.0"]
[com.stuartsierra/lazytest "1.2.3"]]}}
:repositories {"stuart" "http://stuartsierra.com/maven2"})
1 change: 1 addition & 0 deletions test-templates/transform.ftl
@@ -0,0 +1 @@
Hi ${first_name} I heard your last name is ${last_name()}
5 changes: 4 additions & 1 deletion test/freemarker_clj/core_test.clj
@@ -1,5 +1,6 @@
(ns freemarker-clj.core-test
(:use freemarker-clj.core
freemarker-clj.shim
midje.sweet)
(:import [freemarker.template Configuration]))

Expand All @@ -13,7 +14,9 @@
(facts
(render cfg "test-templates/plain.ftl" {}) => "Hello World!\n"
(render cfg "test-templates/basic_model.ftl" {:a "World" :b "Hello"}) => "Hello World!\n"
(render cfg "test-templates/basic_model.ftl" {}) => "Apple Pie!\n"))
(render cfg "test-templates/basic_model.ftl" {}) => "Apple Pie!\n"
(render cfg "test-templates/transform.ftl" {:first-name "Alan" :last-name (fn->method (constantly "Turing"))})
=> "Hi Alan I heard your last name is Turing"))


(let [cfg (gen-config :shared {:a "Pie" :b "Apple"})]
Expand Down
2 changes: 1 addition & 1 deletion test/freemarker_clj/shim_test.clj
Expand Up @@ -3,7 +3,7 @@
(:use freemarker-clj.shim
freemarker-clj.core
midje.sweet))

(set! *warn-on-reflection* true)

(defn pred-check
[pred]
Expand Down

0 comments on commit bb3da18

Please sign in to comment.