我正在自学如何使用Bundler的guide制作自己的Ruby Gem的基础知识。然而,当我使用aruba/cucumber设置CLI测试时,我总是遇到一个问题:
Command "co2domain" not found in PATH-variable "C:/.../PATH variables". (Aruba::LaunchError)我所做的唯一区别是更改了示例的一些名称,因为我最终希望构建一个gem,将公司名称转换为适当的域名。
这是我的company.feature文件:
Feature: Company
In order to portray Company
As a CLI
I want to be as objective as possible
Scenario: Positive number
When I run `co2domain portray --num 2`
Then the output should contain "positive"
Scenario: Negative number
When I run `co2domain portray --num -22`
Then the output should contain "negative"这是我的company.rb文件:
module Co2domain
class Company
def self.portray(num)
if num > 0
"positive"
else
"negative"
end
end
end
end因为我是一个初学者,而这本指南是为初学者准备的,我觉得我错过了一些小但重要的东西。感谢你的帮助。
发布于 2017-07-19 05:46:12
您看到的错误等同于您正在使用的指南中发现的sh: foodie: command not found错误。不同之处在于您使用的是windows计算机,而本指南使用的是*nix计算机。
cucumber测试正在测试从shell运行命令,而shell无法找到要运行的命令。如果您将程序所在的目录添加到PATH中,或者将程序移动到path中的某个目录中,cucumber应该能够运行它。
https://stackoverflow.com/questions/45175002
复制相似问题