Skip to content

Commit

Permalink
Fix final tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiggar committed Jan 3, 2013
1 parent 243469d commit bcfcff4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Distributed under the Eclipse Public License, the same as Clojure.
* Throw a FileNotFoundException instead of failing silently when files in a manifest aren't found
* Directory contents are listed in alphabetical order (avoids intermittent failures due to file directory order on Linux)
* Rewritten internals, with more reliable and consistent string and filename handling
* Referring to X.js.dieter as X.js is no longer supported
* Referring to assets using different extensions is no longer supported

### Version 0.3.0
* Use v8 for Less, Hamlcoffee and CoffeeScript
Expand Down
14 changes: 4 additions & 10 deletions dieter-core/test/dieter/test/path.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,19 @@

(deftest test-cached-file-path
(is (= "resources/asset-cache/assets/foo-d259b08a2dfaf8bf776cbadbe85442d3.js"
(cache/cached-file-path "/assets/foo.js" "content string"))))
(cache/cached-file-path "foo.js" "content string"))))

(deftest test-find-asset
(settings/with-options {:asset-root "test/fixtures"}
(testing "relative path"
(let [file (path/find-asset "./javascripts/lib/framework.js")]
(is (re-matches #".*test/fixtures/assets/javascripts/(\./)?lib/framework.js$"
(let [file (io/file (path/find-asset "./javascripts/lib/framework.js"))]
(is (re-matches #".*test/fixtures/assets/\./javascripts/lib/framework.js$"
(.getPath file)))
(is (.exists file)))
(is (nil? (path/find-asset "./framework.js"))))

(testing "no file exists"
(is (nil? (path/find-asset "dontfindme.txt")))))

(settings/with-options {:cache-root "test/fixtures"}
(testing "different file extension"
(let [file (path/find-asset "basic.css")]
(is (re-matches #".*test/fixtures/assets/stylesheets/basic.less$" (.getPath file)))
(is (.exists file))))))
(is (nil? (path/find-asset "dontfindme.txt"))))))

(defn file= [f1 f2]
(= (.getCanonicalPath (io/file f1))
Expand Down

0 comments on commit bcfcff4

Please sign in to comment.