Clojure开发:单元测试与Java交互全解析
1. 单元测试基础
在Clojure开发中,单元测试是确保代码质量的重要环节。首先,我们需要配置好 project.clj 文件,正确配置后的文件内容如下:
(defproject tdsl "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[org.twitter4j/twitter4j-core "3.0.3"]
[expectations "1.4.49"]
[midje "1.5.1"]
[speclj "2.5.0"]])
若未使用Leiningen工具,可从Clojars仓库(https://clojars.org/speclj )获取JAR文件和依赖信息。
2. 创建测试文件
在继续之前,需在 tdsl/test/tdsl/user_test.clj 创建新的测试文件,
超级会员免费看
订阅专栏 解锁全文
77

被折叠的 条评论
为什么被折叠?



