7

我可以从我的工头 procfile 中运行警卫 - 但输出不像我想要的那样丰富多彩。我在输出中看到的唯一颜色来自工头......

我想要一个管理 rspec、cucumber 和 jasmine 的保护文件——并且在这些测试运行时有漂亮的颜色输出。

似乎工头忽略了保护文件设置。知道如何改变吗?

4

3 回答 3

12

将 --tty 选项添加到您的 rspec 保护 cli:

guard "rspec", :version => 2, :cli => "--tty ...other options..."
于 2012-04-19T14:10:37.947 回答
2

对于guard-rspec以下版本 4.5.0 对我有用

guard :rspec, cmd_additional_args: "--tty", cmd: ...other...
于 2015-07-06T11:35:36.510 回答
0

编辑:更简单,在 Guardfile 中

guard :rspec, cmd: "rspec --force-color"

# In case you do --profile and dot in regular .rspec, you may want to override further:
guard :rspec, cmd: "rspec --force-color --no-profile --format documentation"

/编辑

我为此苦苦挣扎,并让它与 RSpec 3.8、rails 5.2 和 foreman 0.64 一起运行

必须完成两个配置才能使其工作。

# In .rspec, add
--color

# In Guardfile, change to
guard :rspec, cmd: "rspec --tty" do

为什么需要 --color 和 tty 令人困惑,官方 rspec 文档说 tty 和 color 都是默认启用的。

尾注:如果你在做这个,和工头一起跑,它告诉我很多关于你是什么样的开发人员。别说了 ;)

于 2018-10-01T08:18:56.387 回答