【发布时间】:2016-09-02 21:41:55
【问题描述】:
我们有一个 shell 脚本来启动我们的 RSpec 测试。它看起来像这样:
args+=(
"--format" "html"
"--out" "$to_dir/index.html"
)
"$rspec_dir/rspec" "${args[@]}" "$tests_to_run"
exit $?
在尝试升级 RSpec 时,我收到一个错误,指出 :should 语法已被弃用,我们需要像这样显式启用它:How to avoid deprecation warning for stub_chain in RSpec 3.0?
但是,由于我们没有使用 Rake,所以在通过命令行启动 rspec 时,我需要想办法做到这一点。但是当我尝试像这样调整命令行选项时:
./rspec --format "html" --out "index.html" --syntax ":should"
它说--syntax 不是一个有效的选项。如何在通过命令行直接调用 rspec 时启用这种不推荐使用的语法?
(我们不能使用 Rake,因为我们的内部构建工具不支持它。这就是为什么我需要通过命令行找出如何做到这一点。)
【问题讨论】:
标签: ruby command-line rspec syntax