Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex grails的BDD框架(spock/geb/easyb/other)是否支持人类可读描述的正则表达式解析?_Regex_Grails_Cucumber_Bdd_Easyb - Fatal编程技术网

Regex grails的BDD框架(spock/geb/easyb/other)是否支持人类可读描述的正则表达式解析?

Regex grails的BDD框架(spock/geb/easyb/other)是否支持人类可读描述的正则表达式解析?,regex,grails,cucumber,bdd,easyb,Regex,Grails,Cucumber,Bdd,Easyb,我正在尝试正确地处理grails,我想我应该使用测试。我唯一的测试经验是在我朋友教我的3个小时左右的时间里 在cucumber中,将“描述”和“定义”分开,并使用正则表达式。Easyb看起来非常接近,但是描述和定义是相互重叠的 所以在黄瓜里我可以做一些看起来像 given "I have done myFancyThing" then "I should see the fancyThingResponse" given "I have done myNormalThing" then "I

我正在尝试正确地处理grails,我想我应该使用测试。我唯一的测试经验是在我朋友教我的3个小时左右的时间里

在cucumber中,将“描述”和“定义”分开,并使用正则表达式。Easyb看起来非常接近,但是描述和定义是相互重叠的

所以在黄瓜里我可以做一些看起来像

given "I have done myFancyThing"
then "I should see the fancyThingResponse"

given "I have done myNormalThing"
then "I should see normalThingResponse"
然后只有一个函数表示“给定我已经完成了X”和一个函数表示“那么我应该看到X”

以easyb为例,我似乎必须为每个描述重写代码,如

given "I have done myFancyThing"{
  //code code code
}

given "I have done myNormalThing"{
  //cucumber is dryer than easyb?
}

我对easyb的看法错了吗?是否有专门为java/groovy设计的测试框架具有此功能,或者有某种groovy方式将其添加到我没有想到的功能中?

我以前没有使用easyb,但我查看了文档,我认为您是对的。看起来他们不支持正则表达式,我想这会使步骤定义的可重用性变得更加困难


你试过了吗?我们在Java中使用它,它工作得非常好(有您需要的正则表达式支持等)。groovy提供了开箱即用的支持,看起来它将它与grails集成在一起。

看看Geb和Spock。非常棒的测试框架。比用黄瓜好