|
2 | 2 | (:use compojure.html.page-helpers |
3 | 3 | clojure.contrib.test-is)) |
4 | 4 |
|
5 | | -(deftest test-doctype-html4 |
6 | | - (is (= (doctype :html4) |
7 | | - (str "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" " |
8 | | - "\"http://www.w3.org/TR/html4/strict.dtd\">\n")))) |
9 | | - |
10 | | -(deftest test-doctype-xhtml-strict |
11 | | - (is (= (doctype :xhtml-strict) |
12 | | - (str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" " |
| 5 | +(deftest test-doctype |
| 6 | + (testing "html4" |
| 7 | + (is (= (doctype :html4) |
| 8 | + (str "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" " |
| 9 | + "\"http://www.w3.org/TR/html4/strict.dtd\">\n")))) |
| 10 | + (testing "xhtml-strict" |
| 11 | + (is (= (doctype :xhtml-strict) |
| 12 | + (str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" " |
13 | 13 | "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n")))) |
14 | | - |
15 | | -(deftest test-doctype-html5 |
16 | | - (is (= (doctype :html5) |
17 | | - (str "<!DOCTYPE html>")))) |
18 | | - |
19 | | -(deftest test-doctype-xhtml-transitional |
20 | | - (is (= (doctype :xhtml-transitional) |
21 | | - (str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " |
22 | | - "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n")))) |
| 14 | + (testing "html5" |
| 15 | + (is (= (doctype :html5) |
| 16 | + (str "<!DOCTYPE html>")))) |
| 17 | + (testing "xhtml-transitional" |
| 18 | + (is (= (doctype :xhtml-transitional) |
| 19 | + (str "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " |
| 20 | + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"))))) |
23 | 21 |
|
24 | 22 | (deftest test-xhtml-tag |
25 | 23 | (is (= (xhtml-tag "test") |
26 | 24 | [:html {:xmlns "http://www.w3.org/1999/xhtml", "xml:lang" "test", :lang "test"} nil]))) |
27 | 25 |
|
28 | 26 | (deftest test-include-js |
29 | | - (is (= (include-js "foo.js") |
30 | | - '([:script {:type "text/javascript", :src "foo.js"}])))) |
| 27 | + (testing "one" |
| 28 | + (is (= (include-js "foo.js") |
| 29 | + '([:script {:type "text/javascript", :src "foo.js"}])))) |
| 30 | + (testing "many" |
| 31 | + (is (= (include-js "foo.js" "bar.js" "baz.js") |
| 32 | + '([:script {:type "text/javascript", :src "foo.js"}] |
| 33 | + [:script {:type "text/javascript", :src "bar.js"}] |
| 34 | + [:script {:type "text/javascript", :src "baz.js"}]))))) |
31 | 35 |
|
32 | 36 | (deftest test-include-css |
33 | | - (is (= (include-css "foo.css") |
34 | | - '([:link {:type "text/css" :href "foo.css" :rel "stylesheet"}])))) |
| 37 | + (testing "one" |
| 38 | + (is (= (include-css "foo.css") |
| 39 | + '([:link {:type "text/css" :href "foo.css" :rel "stylesheet"}])))) |
| 40 | + (testing "many" |
| 41 | + (is (= (include-css "foo.css" "bar.css" "baz.css") |
| 42 | + '([:link {:type "text/css", :href "foo.css", :rel "stylesheet"}] |
| 43 | + [:link {:type "text/css", :href "bar.css", :rel "stylesheet"}] |
| 44 | + [:link {:type "text/css", :href "baz.css", :rel "stylesheet"}]))))) |
35 | 45 |
|
36 | 46 | (deftest test-javascript-tag |
37 | 47 | (is (= (javascript-tag "alert('hi');") |
|
0 commit comments