我正在使用 Cucumber 和 Aruba 来测试在GLI之上编写的 Ruby 命令行应用程序。为了防止测试影响生产数据,我更新ENV['HOME']
为指向测试目录。我想检查测试ENV['HOME']
目录中是否存在文件。我想为此使用 Aruba,但我无法ENV['HOME']
正确扩展。
例如:
Scenario: Testing config files are found
Given I switch ENV['HOME'] to be "set_a" of test_arena
Then a file named "#{ENV['HOME']}/config.xml" should exist
是否可以将 ENV['HOME'] 传递给 Aruba 的Then a file named "" should exist
step_definition 并将其扩展到完整路径?