#111 √ resolved
James B. Byrne

RedGreen gone from autotest + cucumber

Reported by James B. Byrne | December 2nd, 2008 @ 05:54 PM | in 0.1.12

cucumber 0.1.11

The red/green/yellow feature step highlighting has disappeared from cucumber autotest results. Highlighting is present when cucumber is invoked from both:

rake features

cucumber features -r features

Comments and changes to this ticket

  • James B. Byrne

    James B. Byrne December 2nd, 2008 @ 05:57 PM

    This is somehow related to cucumber since the standard TestUnit test results still report with redgreen highlighting even though the cucumber results do not.

  • James B. Byrne

    James B. Byrne December 2nd, 2008 @ 05:58 PM

    Further, reverting to cucumber 0.1.10 and making no other changes restore the redgreen highlighting to cucumber results.

  • Aslak Hellesøy
  • Alan Larkin

    Alan Larkin December 2nd, 2008 @ 07:53 PM

    I'm struggling to figure out how to fix this. Rather than simply invoking cucumber and letting it do the IO, my change (http://github.com/aslakhellesoy/... is capturing the IO and printing it/storing it. The problem is that the colour data is being lost somwhere inbetween f.getc and $stdout.putc and I don't know how to prevent that ...

    As the change was unlikely to have been of interest to many I would suggest reverting it for the time being.

    SORRY!

  • Aslak Hellesøy

    Aslak Hellesøy December 2nd, 2008 @ 08:04 PM

    In ansicolor.rb you'll see that colours are turned of if out is not

    tty? This is to avoid colour codes when output is > to a file. This

    might be why.

    Can you explain the intent of your commit in more detail? I'm guilty of pulling it without understanding what problem it's supposed to solve.

  • Alan Larkin

    Alan Larkin December 2nd, 2008 @ 08:27 PM

    I was trying to write an Autotest.add_hook(:ran_features) which would summarise the cucumber output (e.g. "5 Passed, 1 Pending, 2 Failed") in a knotify popup on my linux box.

    I couldn't see any other way (though perhaps I'm wrong) of getting that information into my hook other than storing the cucumber output in self.results in the same way that the output from the specs is. So I took a look at how autotest set this attribute in #run_tests and it was done with the code I added (which seemed reasonable at the time :))

  • Aslak Hellesøy

    Aslak Hellesøy December 2nd, 2008 @ 09:06 PM

    Nothing to be sorry about Alan. I'll be busy till next week. Will look into it then. Or just pull some new code when I get back.

  • Alan Larkin

    Alan Larkin December 2nd, 2008 @ 11:57 PM

    Think I've sorted it. Eventually noticed this in cucumber --help

    "If neither --color or --no-color is given decides based on your platform and the output destination"

    implying simply specifying --color would prevent the disabling of colour codes in ansicolor.rb mentioned above, which, happily, it did.

    I pushed to my repo at git://github.com/al/cucumber.git.

    I'll leave this open until confirmation.

  • James B. Byrne

    James B. Byrne December 3rd, 2008 @ 03:44 PM

    I can confirm that adding --color to the autotest profile in cucumber.yml corrects the problem in cucumber 0.1.11.

    
    autotest: features -r features --format pretty --color
    
  • Aslak Hellesøy

    Aslak Hellesøy December 3rd, 2008 @ 06:03 PM

    • → Milestone changed from “” to “0.1.12”
    • → State changed from “new” to “resolved”

    Thanks for the quick bugfix Alan!

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

TreeTop based implementation of rbehave (a.k.a. Story Runner, a.k.a. Feature Runner)

http://github.com/aslakhellesoy/cucumber

Tags