easyb学习笔记

1.关于given,when和then的解释

These three words bind a feature together with a means to verify it, because the words describe a flow or sequence of events:

  1. Given some context,
  2. When something happens,
  3. Something else should happen. 

 

2.

3.

In easyb, scenarios — not stories — have states. A scenario can be in a passing, failing, or pending state. Pending is handy because it can indicate that a particular scenario is actively being worked on. Failing, obviously, indicates an error condition either occurring in the application being verified or possibly in how the scenario is defined.

Scenarios in easyb define steps using the keywords given, when, then, and optionally and. Each keyword definition in a scenario looks a lot like the scenario keyword definition, as Listing 10 shows:


 

4.then

 

easyb supports a host of similar checks, including:

  • shouldNotBe
  • shouldEqual
  • shouldNotEqual
  • shouldBeGreaterThan
  • shouldBeLessThan

5.file extension

 

The stories in easyb should and must be in a file ending with an extension of .story. So our login story would be placed in a file called LoginServiceTest.story.

 

If you have a story named  AccountServiceTest.groovy, you will get an exception as such:

Buildfile: /Users/meerasubbarao/Development/easyb-samples/build.xml
init:
run.easyb.stores:
    [easyb] easyb is preparing to process 2 file(s)
    [easyb] Easyb behavior file must end in Story.groovy, .story, Specification.groovy or .specification. See easyb documentation for more details.
    [easyb] easyb execution FAILED
BUILD SUCCESSFUL
Total time: 1 second

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值