fix failing tests

This commit is contained in:
Gered 2014-06-14 17:55:02 -04:00
parent e0b21871a6
commit 6dd4a1d105

View file

@ -28,17 +28,25 @@
{"name" "Bob"}) {"name" "Bob"})
"Hello Bob!") "Hello Bob!")
"passing a model-map where the keys are strings already") "passing a model-map where the keys are strings already")
(do
(set-options! :stringify-keys false)
(is (= (render "Hello {{ name }}!" (is (= (render "Hello {{ name }}!"
{"name" "Bob"} {"name" "Bob"})
{:skip-model-map-stringify? true})
"Hello Bob!") "Hello Bob!")
"passing a model-map where the keys are strings already and we want to skip auto stringifying bbb") "passing a model-map where the keys are strings already and we want to skip auto stringifying bbb")
(set-options! :stringify-keys true))
(do
(set-options! :stringify-keys false)
(is (thrown? (is (thrown?
ClassCastException ClassCastException
(render "Hello {{ name }}!" (render "Hello {{ name }}!"
{:name "Bob"} {:name "Bob"}))
{:skip-model-map-stringify? true})) "passing a model-map where the keys are keywords and try skipping auto stringifying the keys")
"passing a model-map where the keys are keywords and try skipping auto stringifying the keys")))
(set-options! :stringify-keys true))))
(deftest passing-model-map-data (deftest passing-model-map-data
(testing "Passing Clojure data structures to JTwigContext's" (testing "Passing Clojure data structures to JTwigContext's"
@ -108,14 +116,22 @@
{"name" "Bob"}) {"name" "Bob"})
"Hello Bob from a file!") "Hello Bob from a file!")
"passing a model-map where the keys are strings already") "passing a model-map where the keys are strings already")
(do
(set-options! :stringify-keys false)
(is (= (render-file test-filename (is (= (render-file test-filename
{"name" "Bob"} {"name" "Bob"})
{:skip-model-map-stringify? true})
"Hello Bob from a file!") "Hello Bob from a file!")
"passing a model-map where the keys are strings already and we want to skip auto stringifying bbb") "passing a model-map where the keys are strings already and we want to skip auto stringifying bbb")
(set-options! :stringify-keys true))
(do
(set-options! :stringify-keys false)
(is (thrown? (is (thrown?
ClassCastException ClassCastException
(render-file test-filename (render-file test-filename
{:name "Bob"} {:name "Bob"}))
{:skip-model-map-stringify? true})) "passing a model-map where the keys are keywords and try skipping auto stringifying the keys")
"passing a model-map where the keys are keywords and try skipping auto stringifying the keys"))))
(set-options! :stringify-keys true)))))