Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

better name: testing-fn

  • Loading branch information...
commit e05bd9d6c74c6dce36150cdf0dcf9cbedcd9f533 1 parent 1e89179
@stuarthalloway authored
View
2  examples/the-rspec-book/greeter_test.clj
@@ -5,5 +5,5 @@
(describe "Circumspec Greeter"
(it "should say hello"
(should (= "Hello Circumspec!" (greet))))
- (describe-function greet
+ (testing-fn greet
(=> "Hello Circumspec!")))
View
6 features/failure_example.clj
@@ -6,10 +6,12 @@
(should (throws? Exception)))
(testing "not equal should fail"
- (should (= (+ 1 41) 43)))
+ (should
+ (= (+ 1 41) 43)))
(testing "error not thrown should fail"
- (should (throws? ArithmeticException (+ 1 2))))
+ (should
+ (throws? ArithmeticException (+ 1 2))))
(testing "wrong error message should fail"
(let [x 0]
View
2  src/circumspec.clj
@@ -14,7 +14,7 @@
(migrate
{'circumspec.context '[describe]
- 'circumspec.test '[testing it describe-function]
+ 'circumspec.test '[testing it testing-fn]
'circumspec.for '[for-these]
'circumspec.should '[should]
'circumspec.locator '[test-namespaces tests]
View
4 src/circumspec/test.clj
@@ -28,10 +28,10 @@
(= (apply ~fn ~(apply vector (take (- c 2) form)))
~(last form)))))
-(defmacro describe-function
+(defmacro testing-fn
[fn-name & forms]
`(defn! ~(with-meta (test-function-name fn-name) (test-function-metadata (resolve fn-name) forms))
- "Generated test from the describe-function macro."
+ "Generated test from the testing-fn macro."
[]
~@(map #(rewrite-=> fn-name %) forms)))
View
7 src/circumspec/watch.clj
@@ -5,6 +5,7 @@
[circumspec.utils :only (with-re-defn)]
[circumspec.runner :only (run-tests)]
[circumspec.locator :only (tests test-namespaces)]
+ [circumspec.report :only (pending-string)]
[clojure.contrib.def :only (defvar)]
[clojure.contrib.str-utils :only (re-sub)]
[clojure.contrib.java-utils :only (as-file)]))
@@ -83,7 +84,11 @@
([namespaces]
(with-re-defn
(doseq [n namespaces]
- (require :reload (test-ns->source-ns n))
+ (try
+ (require :reload (test-ns->source-ns n))
+ (catch
+ java.io.FileNotFoundException fnfe
+ (println (pending-string (.getMessage fnfe)))))
(require :reload n)))
(run-tests (tests namespaces))
nil))
View
8 test/circumspec/report/nested_test.clj
@@ -2,24 +2,24 @@
(:use circumspec circumspec.report.nested)
(:use [circumspec.config :only (colorize)]))
-(describe-function indent
+(testing-fn indent
(0 "foo" => "foo")
(1 "bar" => " bar")
(2 "baz" => " baz"))
-(describe-function indent-lines
+(testing-fn indent-lines
(0 nil => nil)
(0 "foo\nbar" => "foo\nbar")
(1 "foo\nbar" => " foo\n bar"))
-(describe-function context-lines
+(testing-fn context-lines
(nil nil => [])
({} {} => [])
({} {:context ["level 1"]} => ["level 1"])
({:context ["level 1"]} {:context ["level 1"]} => [])
({:context ["1"]} {:context ["1" "2"]} => [" 2"]))
-(describe-function story-lines
+(testing-fn story-lines
(nil => [])
({:context ["level 1"]} => [])
({:context [], :story ["given this" "then that"]}
View
6 test/circumspec/test_test.clj
@@ -16,14 +16,14 @@
(should (= (t/rewrite-=> '+ '[1 2 => 3])
'(circumspec.should/should (clojure.core/= (clojure.core/apply + [1 2]) 3)))))
-(testing "describe-function"
+(testing "testing-fn"
(should (= '(circumspec.utils/defn! add-test
- "Generated test from the describe-function macro."
+ "Generated test from the testing-fn macro."
[]
(circumspec.should/should (clojure.core/= (clojure.core/apply add [1 2]) 3))
(circumspec.should/should (clojure.core/= (clojure.core/apply add [4 5]) 9)))
(macroexpand-1
- '(circumspec.test/describe-function add (1 2 => 3) (4 5 => 9))))))
+ '(circumspec.test/testing-fn add (1 2 => 3) (4 5 => 9))))))
(testing "test-function-name"
(should (= 'foo-test (t/test-function-name 'foo)) "symbol that does not resolve")
View
4 test/circumspec/utils_test.clj
@@ -25,12 +25,12 @@
[1 2 []] [[odd? even?] [1 2]]
['throws? IllegalArgumentException [0]] [[symbol? class?] ['throws? IllegalArgumentException 0]]))
-(describe-function class-symbol?
+(testing-fn class-symbol?
('dribble.dribble.Shoot => false)
('String => true)
('java.lang.String => true))
-(describe-function java-props->sh-args
+(testing-fn java-props->sh-args
({:foo "bar"} => ["-Dfoo=bar"])
({"baz" "quux"} => ["-Dbaz=quux"])
({:one "1" :two "2"} => ["-Done=1" "-Dtwo=2"]))
View
6 test/circumspec/watch_test.clj
@@ -2,13 +2,13 @@
(:use circumspec)
(:require [circumspec.watch :as w]))
-(describe-function w/source-ns->test-ns
+(testing-fn w/source-ns->test-ns
('foobar => 'foobar-test))
-(describe-function w/test-ns->source-ns
+(testing-fn w/test-ns->source-ns
('foobar-test => 'foobar))
-(describe-function w/test-namespace
+(testing-fn w/test-namespace
("src/circumspec/runner.clj" => 'circumspec.runner-test)
("test/circumspec/runner_test.clj" => 'circumspec.runner-test))
Please sign in to comment.
Something went wrong with that request. Please try again.