从“rake cucumber”中删除有关 ansicon 的警告
当您在未安装 ANSICON 的计算机上运行安装了 Cucumber 的任何 rake 任务时,您会收到以下消息:
*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows
When running local I like using ANSICON, but when using inside the build server I don't care about that - 并且我不想在那里看到那个警告。有办法摆脱它吗?
When you run any rake task with cucumber installed on a machine that doesn't have ANSICON installed, you get the following message:
*** WARNING: You must use ANSICON 1.31 or higher (http://adoxa.110mb.com/ansicon) to get coloured output on Windows
When running locally I like using ANSICON, but when used within the build server I don't care about that - and I don't want to see that warning there. Is there a way to get rid of it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您实际上可以删除警告本身。我不喜欢为了一个绿字而安装一堆垃圾。因此,要删除警告:
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. 找到以下行:
并在其前面添加 # 将其注释掉:
行号为 14对于我的黄瓜版本。
4.保存文件即可完成
You can actually remove the warning itself. I do not like installing a bunch of garbage just for the sake of having a green word. So, to remove the warning:
1. Locate the Cucumber installation in gems directory (it's in the Ruby installation directory). For me it was: lib\ruby\gems\1.9.1\gems\cucumber-1.2.0
2. In the cucumber-1.2.0\lib\cucumber\formatter directory of the Cucumber installation find the file ansicolor.rb
3. Locate the line:
and add # in front of it to comment it out:
The line number was 14 for my version of Cucumber.
4. Save the file and you're done
在 Windows 上获取彩色输出结果
get the coloured output result on Windows
你能为你的spec_helper.rb添加一个例外吗?或者尝试添加一个在使用 rake 时过滤的标签?
Can you add an exception to you spec_helper.rb? Or perhaps try adding a tag which you filter on when using rake?