Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f34582
commit 76a6c4c
Showing
4 changed files
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
(ns dieter.test.asset.less | ||
(:require [clojure.java.io :as io] | ||
[dieter.asset.less :as less] | ||
[dieter.settings :as settings] | ||
[dieter.test.helpers :as h]) | ||
(:use clojure.test)) | ||
|
||
(deftest test-preprocess-less | ||
(testing "basic less file" | ||
(settings/with-options | ||
{:compress false} | ||
(testing "basic less file" | ||
(is (= "#header {\n color: #4d926f;\n}\n" (less/preprocess-less (io/file "test/fixtures/assets/stylesheets/basic.less"))))) | ||
(testing "file with imports" | ||
(testing "file with imports" | ||
(is (= "#includee {\n color: white;\n}\n#includee-three {\n color: white;\n}\n#includee-two {\n color: white;\n}\n#includer {\n color: black;\n}\n" | ||
(less/preprocess-less (io/file "test/fixtures/assets/stylesheets/includes.less"))))) | ||
(testing "bad less syntax" | ||
(testing "bad less syntax" | ||
(try | ||
(less/preprocess-less (io/file "test/fixtures/assets/stylesheets/bad.less")) | ||
(is false) ; test it throws | ||
(catch Exception e | ||
(is (h/has-text? (.toString e) "Syntax Error on line 1")) | ||
(is (h/has-text? (.toString e) "@import \"includeme.less\"")))))) | ||
(is (h/has-text? (.toString e) "@import \"includeme.less\""))))))) |