Clojure的BDD测试框架[关闭]

问题描述 投票:0回答:4

谷歌搜索从过去几年中只揭示了这个问题的答案,我在github上看过的一些项目已经很长时间没有提交了。目前有人正在做任何事情吗?我很感兴趣。还做什么并行测试?我是Clojure的新手,但似乎缺少的一件事是测试框架和ScalaTest一样好。

clojure bdd
4个回答
3
投票

我认为speclj仍然活跃。


1
投票

https://github.com/zenmodeler/spexec是一个相对较新的东西,致力于BDD。


1
投票

https://github.com/cucumber/cucumber-jvm也有clojure支持,并且在clojure目录中有一个可运行的例子;它的一个扩展例子就在这里:https://github.com/gphilipp/bdd-guide-clojure


1
投票

Eggplant是一个令人兴奋的新的BDD开源库,用于Clojure。你也可以读一下here

例如:

(defspec multiplying-two-numbers
  (specification
   {:given "a input of :a and :b"
    :when  "we #* :c"
    :then  "we expect :result"
    :data {:a 3 :b 4 :result 12}}))

(defspec change-a-string-to-uppercase
 (specification
  {:given "a input of :a"
   :when  "we #clojure.string/upper-case"
   :then  "we expect :result"
   :data {:a "hello" :result "HELLO"}}))

(defspec finding-the-max-of-two-numbers
 (specification
  {:expect "the #max of :a and :b"
   :where  {:a 2 :b 3 :expected 3}}))

“简单是关键”

五个关键词:

  • 特定
  • 什么时候
  • 然后
  • 期望
  • 哪里

https://github.com/perkss/eggplant

专注于数据驱动开发并通过示例使用人类可读形式对其进行测试,该形式随着测试的增长而维护规范文档。

标准的clojure.test将运行这些与任何IDE和构建工具兼容。

开发人员可以在很短的时间内编写一个快速易于遵循的BDD测试。

© www.soinside.com 2019 - 2024. All rights reserved.