forked from stuarthalloway/circumspec
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed raw creating invalid filenames under Windows.
- Loading branch information
1 parent
a7ba0c0
commit 2eeb1fb
Showing
2 changed files
with
13 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
(ns circumspec.raw-test | ||
(:use circumspec circumspec.raw)) | ||
(:use circumspec circumspec.raw) | ||
(:import java.io.File) | ||
) | ||
|
||
;; TODO: better filename convention | ||
(describe dump-file | ||
(it "creates a file in .circumspec/raw" | ||
(let [file (dump-file)] | ||
(let [file (dump-file) | ||
separator (java.io.File/separator) | ||
escapedSeparator (if (= separator "\\") "\\\\" (str separator)) | ||
filePattern (str "[.]circumspec" escapedSeparator "raw" escapedSeparator ".*") | ||
] | ||
(should (instance? java.io.File file)) | ||
(should (re-find #"\.circumspec/raw/.*" (.toString file)))))) | ||
(should (not (re-find #":" (.toString file)))) | ||
(should (re-find (re-pattern filePattern) (.toString file)))))) | ||
|
||
(describe dump-results | ||
(it "writes complete restuls to a file" | ||
(it "writes complete results to a file" | ||
(let [file (dump-results (take 2 (repeat {:sample true})))] | ||
(should (= "{:sample true}\n{:sample true}\n" (slurp (.toString file)))) | ||
(should (.delete file) "deleting sample result data")))) |