HomePhorge

(Maint) Enable colorized rspec output on Windows
4ffc02d22093Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(Maint) Enable colorized rspec output on Windows

Commit 83cfe9d added colorized rspec output by default. Unfortunately,
this doesn't work on Windows and causes ANSI escape characters to be
printed to stdout.

Although we load the win32console gem while requiring puppet, rspec
always writes to $stdout and $stderr that it was started with. So
later when the win32console gem overwrites those streams, the formatters
have already been created with the old ones.

This commit modifies the spec helper to reset the stdout and stderr
streams on the configuration object, as well as each of the formatters.
Unfortunately, the formatter does not expose an accessor for its output
variable. I tested with 2.9 and 2.11, and both work as expected, i.e.
color on Windows.

This commit doesn't change behavior on non-Windows platforms.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU5db4c6ed9003: Merge branch 'backport-15739_report_format_version' into 2.7.x
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU4ffc02d22093: (Maint) Enable colorized rspec output on Windows (authored by Josh Cooper <josh@puppetlabs.com>).Aug 29 2012, 9:51 AM