黄瓜:背景失败仍然以代码0退出

Sir*_*lot 2 ruby scenarios exit-code cucumber

我想知道什么,当背景失败时,黄瓜会返回退出代码0(据我所知,这意味着"确定").

现在失败的步骤可能不应该在背景中(最好在'之前'钩子我想 - ).但有人知道它退回此退出代码的理念是什么?这是一个错误还是一个功能?

附录:一个更具体的例子:让我们说这段代码通过:

 Feature: Figuring out how Cucumber works

 As a developer
 I want to find out why cuccies fail, but my build doesnt
 In order to have more confidence in my build

 Background: logging in into the system
   Given I am logged in

 Scenario: creating a new test set
   When I do something
   Then I should see "you've done something"
Run Code Online (Sandbox Code Playgroud)

它返回退出代码0.让它失败:

 Background: logging in into the system
   Given I am logged in

 Scenario: creating a new test set
   Then I should see "there's no way you see this"
   When I do something
   Then I should see "you've done something"
Run Code Online (Sandbox Code Playgroud)

输出显示失败的步骤,并返回退出代码1当我将失败的步骤移动到后台时:

 Background: logging in into the system
   Given I am logged in
   Then I should see "there's no way you see this"

 Scenario: creating a new test set
   When I do something
   Then I should see "you've done something"
Run Code Online (Sandbox Code Playgroud)

输出仍然显示失败,但它返回退出代码0

Sir*_*lot 5

我问过Cucumber的人(他们的邮件列表)并且他们同意了它的错误

http://groups.google.com/group/cukes/browse_thread/thread/e56699f0fabfc75f