diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2011-01-28 16:12:26 -0500 |
---|---|---|
committer | Stuart Halloway <stu@Stuart-Halloways-MacBook-Air.local> | 2011-02-25 14:33:06 -0500 |
commit | 9c0728f269f32531dc3b8b6bbe84631e46da5f7a (patch) | |
tree | cdd66b34d1838426e0194eeaf99f0b619c53c19c | |
parent | f5ca90d25e067a2c9131f549eca3a008bd1c8308 (diff) |
Do not check for specific exception types or messages in reify; refs CLJ-728
Signed-off-by: Stuart Halloway <stu@Stuart-Halloways-MacBook-Air.local>
-rw-r--r-- | test/clojure/test_clojure/protocols.clj | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/clojure/test_clojure/protocols.clj b/test/clojure/test_clojure/protocols.clj index b46fbdf2..c04a47d9 100644 --- a/test/clojure/test_clojure/protocols.clj +++ b/test/clojure/test_clojure/protocols.clj @@ -252,16 +252,14 @@ (is (false? (.contains r :bar))) (is (false? (.isEmpty r))))) (testing "you can't define a method twice" - (is (fails-with-cause? - java.lang.ClassFormatError #"^(Repetitive|Duplicate) method name" + (is (thrown? Exception (eval '(reify java.util.List (size [_] 10) java.util.Collection (size [_] 20)))))) (testing "you can't define a method not on an interface/protocol/j.l.Object" - (is (fails-with-cause? - IllegalArgumentException #"^Can't define method not in interfaces: foo" + (is (thrown? Exception (eval '(reify java.util.List (foo [_])))))) (testing "of a protocol" (let [r (reify @@ -288,8 +286,7 @@ (is (= :done (.get r 1))))) (testing "disambiguating with type hints" (testing "you must hint an overloaded method" - (is (fails-with-cause? - IllegalArgumentException #"Must hint overloaded method: hinted" + (is (thrown? Exception (eval '(reify clojure.test_clojure.protocols.examples.ExampleInterface (hinted [_ o])))))) (testing "hinting" (let [r (reify |