Foreman running guard with color ouput

喜夏-厌秋 提交于 2019-12-02 21:16:37

Add the --tty option to your rspec guard cli:

guard "rspec", :version => 2, :cli => "--tty ...other options..."

For version 4.5.0 of guard-rspec the following worked for me

guard :rspec, cmd_additional_args: "--tty", cmd: ...other...

EDIT: Even simpler, in Guardfile do

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"

/EDIT

I struggled with this and got it running with RSpec 3.8, rails 5.2 and foreman 0.64

Two configs must be done to make it work.

# In .rspec, add
--color

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

It's confusing why --color and tty are needed, the official rspec documentation says that both tty and color are default enabled.

Endnote: if you are doing this, running guard with foreman, it tells me a lot about what kind of developer you are. Say no more ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!