Clojure测试框架的优点? [英] Strengths of Clojure testing frameworks?

查看:122
本文介绍了Clojure测试框架的优点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你更喜欢哪一个,为什么?每个人的利弊是什么?

Which one do you prefer and why? What are the pros and cons of each? In which scenario does each outshine the others?

我对midje和clojure.test特别感兴趣,但随时可以提出其他Clojure测试框架。

I'm particularly interested in midje vs. clojure.test, but feel free to bring up other Clojure testing frameworks too.

另请参见最佳单元测试框架对于Clojure?(该问题的答案没有提供关于为什么的详细信息)。

See also Best unit testing framework for Clojure? (the answers to that question didn't provide much detail on the "why").

推荐答案

我更喜欢 Midje 。 Midje提供了一个从clojure.test到更灵活,可读,更抽象,更亲切的测试风格的迁移路径。

I prefer Midje. Midje provides a migration path from clojure.test to a more flexible, readable, abstract, and gracious style of testing.

Midje支持自上而下和自下而上TDD样式,并且包含嘲笑和存根设施,以及一些强大的功能,如检查器,metaconstants,表格事实。

Midje supports top-down as well as bottom-up TDD styles, and has mocking and stubbing facilities baked into it, as well as some powerful features like checkers, metaconstants, tabular facts.

Midje wiki

这里有一个简单的例子:

Here's a simple example:

(fact "Midje can do simple stubbing"
  (+ (a) 2) => 5
  (provided 
    (a) => 3))

这篇关于Clojure测试框架的优点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆