Remove the ansicon warning from "rake cucumber"

When you run any rake command with a cucumber installed on a machine that does not 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 to use ANSICON, but when using the build server on the server, I don't care and I don't want to see this warning. Is there any way to get rid of it?

+4
source share
3 answers

In fact, you can remove the warning. I don't like setting up a bunch of trash just for the sake of the green word. So, to remove the warning:

1. Locate the cucumber plant in the gem catalog (located 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. Find the line:

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

and add # in front of it to comment on this:

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

The line number was 14 for my version of Cucumber.

4. Save the file and you're done

+12
source
  • Download and unzip the file from http://adoxa.altervista.org/ansicon/
  • open cmd and navigate to the unzipped folder
  • Go to x64 (if you have a 64-bit machine), otherwise go to x86
  • Type ansicon.exe -h and you will get the help of this command
  • Run 'ansicon.exe -i' to install and add ansicon to your Windows
  • Run the cucumber test 0.10.0, and you should get the color output result on Windows
+1
source

Can you add an exception to you spec_helper.rb? Or maybe try adding a tag that you filter when using rake?

0
source

All Articles