为了将 Cucumber 用于命令行脚本,我按照提供的说明安装了 aruba gem。它在我的 Gemfile 中,我可以验证是否安装了正确的版本并且我已经包含
require 'aruba/cucumber'
在“功能/env.rb”中
为了确保它有效,我编写了以下场景:
@announce
Scenario: Testing cucumber/aruba
Given a blank slate
Then the output from "ls -la" should contain "drw"
假设事情应该失败。
它确实失败了,但由于错误的原因而失败:
@announce
Scenario: Testing cucumber/aruba
Given a blank slate
Then the output from "ls -la" should contain "drw"
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[] (NoMethodError)
features/dataloader.feature:9:in `Then the output from "ls -la" should contain "drw"'
任何人都知道为什么这不起作用?这似乎是非常基本的阿鲁巴行为。