Skip to Main Content
Cucumber Recipes
book

Cucumber Recipes

by Ian Dees, Matt Wynne, Aslak Hellesoy
February 2013
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 45m
English
Pragmatic Bookshelf
Content preview from Cucumber Recipes
Recipe 23Get Good Text Output on Windows

Problem

You’re running Cucumber on Windows and want the console output to be green or red based on the pass/fail status of the steps. You also want non-U.S. characters to show up correctly in the output.

Ingredients

  • ANSICON, a Windows helper for ANSI colored output[142]

  • Windows’s built-in chcp command for setting the code page[143]

  • The Consolas[144] or Lucida Console[145] font (both of which ship with recent Windows versions) for correctly displaying Unicode characters

  • Ruby 1.9.x, which handles Unicode better than 1.8.x

Solution

Most command-line environments support cursor movement and text coloring through ANSI escape codes,[146] sequences of special characters that a program can print as part ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cucumber Cookbook

Cucumber Cookbook

Shankar Garg
Basiswissen Softwaretest , 6th Edition

Basiswissen Softwaretest , 6th Edition

Andreas Spillner, Tilo Linz
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781941222607Errata