How do I get colour with Windows command prompt using RSpec in Ruby?

前端 未结 8 3109
迷失自我
迷失自我 2021-02-20 03:10

In other o/s RSpec returns nicely coloured results (red, green etc).

However in the windows (Vista) command prompt my text output is just plain old boring white.

8条回答
  •  礼貌的吻别
    2021-02-20 04:05

    When using the MINGW64 bash shell provided by Git on Windows rspec displays things without any color. While this shell environment is perfectly capable of displaying ANSI color, rspec fails to detect it as a TTY. A super simple workaround is to use:

    $ rspec --force-color
    

    For example, take this boring old monochrome: :

    And make it happy with one simple command line argument:

提交回复
热议问题