【发布时间】:2015-11-09 19:33:20
【问题描述】:
当我使用rspec --format documentation 输出到标准输出时,我得到如下信息:
User adds a third site and successfully credentials PayPal on FEB-17-2015
Invoices the customer with a pro-rated Pro plan for the 3 unused days credited (PENDING: Not yet implemented)
这是期望的行为。
但是,当我使用 rspec --format documentation --out spec.txt 时,我得到了这个:
User adds a third site and successfully credentials PayPal on FEB-17-2015
[33m Invoices the customer with a pro-rated Pro plan for the 3 unused days credited (PENDING: Not yet implemented)[0m
格式现在无法读取,此添加的一侧是[33m,另一侧是[0m。
上述行为与文档中描述的示例背道而驰:
问题:如何使文本匹配所需的标准输出?
【问题讨论】:
-
不可读怎么定义?
-
这些看起来像 ANSI 颜色代码,而不是持续时间 :) 尝试在 rspec 上禁用颜色输出(不知道该怎么做)。
-
酷,我查了一下颜色,发现了这个:ruby-forum.com/topic/3447958