cucumber - 从 "rake cucumber"中删除关于 ansicon 的警告

标签 cucumber warnings

当您在没有安装 ANSICON 的机器上运行安装了 Cucumber 的任何 rake 任务时,您会收到以下消息:

*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows

在本地运行时,我喜欢使用 ANSICON,但在构建服务器中使用时,我不在乎 - 而且我不想在那里看到该警告。有没有办法摆脱它?

最佳答案

您实际上可以删除警告本身。我不喜欢为了有一个绿色词而安装一堆垃圾。因此,要删除警告:

1. 在 gems 目录中找到 Cucumber 安装(它在 Ruby 安装目录中)。对我来说是: lib\ruby\gems\1.9.1\gems\cucumber-1.2.0

2. 在Cucumber安装的cucumber-1.2.0\lib\cucumber\formatter目录下找到文件 ansicolor.rb

3. 定位行:

STDERR.puts %{*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows}



并在其前面添加# 以将其注释掉:

# STDERR.puts %{*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows}



我的 Cucumber 版本的行号是 14。

4. 保存文件,大功告成

关于cucumber - 从 "rake cucumber"中删除关于 ansicon 的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7019013/

相关文章:

Java/Selenium WebDriver : Focus Don't skip to Else If block when the warning message matches on webpage

python - python 是否像 perl 中那样有 "use strict;"和 "use warnings;"?

jsf - 警告 : @FacesConverter is using both value and forClass, 仅应用值

android - android 4.0下的奇怪异常与eclipse

c++ - 请帮助 : [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]

python - Specifically silent Pandas SettingWithCopyWarning 使用警告上下文管理器?

gradle - Gradle 项目的 Runner 类中无法解析导入 cucumber

iphone - 我如何向下滚动 UITable View ,直到我在 Calabash 中看到标签为 "Value"的单元格

variables - 如何在标题中获取 cucumber 场景变量?

ruby - 使用cucumber/capybara时有没有类似于selenium grid的东西?