为什么RSpec为什么要在终端屏幕的顶部打印一串大写的F?

我只是像往常一样尝试运行rspec,这应该为我提供如下输出:

karenlee@Karens-MBP karen_lee % rspec

#caesar_cipher
  encodes a simple word
  wraps around the alphabet
  encodes multiple words

#digital_root
  calculates the digital root of a single-digit number
  calculates the digital root of a larger number

但是当我今天运行它时,它给了我这样的输出:

karenlee@Karens-MBP mancala % rspec
FFFFFFFFFFFFFFFFF

Failures:

  1) Board#initialize creates a set of 14 cups
     Failure/Error: @cups = Set.new(14)

     ArgumentError:
       value must be enumerable

另一方面,我还通过Visual Studio的LiveShare(我是主持人)进行了一次配对编程会话,并且我注意到,只要我的伙伴在VS Code的共享终端屏幕上键入“ rspec”,就会输出rspec类似于本文中的第一个示例。那么为什么当我在自己的计算机上运行“ rspec”时,却打印出“ F”的字符串而不是第一个示例中的实际规范?

我仔细检查了我的gem列表,并安装了以下rspec gem(用于rspec):

rspec (3.9.0,3.1.0)
rspec-core (3.9.0,3.1.7)
rspec-expectations (3.9.0,3.1.2)
rspec-mocks (3.9.0,3.1.3)
rspec-support (3.9.0,3.1.2)
rubygems-update (3.0.6)
liuchangqi 回答:为什么RSpec为什么要在终端屏幕的顶部打印一串大写的F?

此输出格式由--format选项控制。

但是rspec还有另一个功能,它可以从项目中的.rspec文件中读取选项,因此您可能想要

$ cat .rspec
--color
--require rails_helper

选中rspec -h了解更多信息

  **** Output ****

    -f,--format FORMATTER             Choose a formatter.
                                         [p]rogress (default - dots)
                                         [d]ocumentation (group and example names)
                                         [h]tml
                                         [j]son
                                         custom formatter class name

F用于失败,将.(点)用于通过的方法称为progress格式。您伴侣的另一个伴侣可能是documentation

本文链接:https://www.f2er.com/3069087.html

大家都在问