开发者

How do I keep the *colorized* output result of a command when printing the result of a command in Ruby?

Here's the thing:

I run a bunch of Cucumber tests from a ruby file by calling the command like this:

result = `bundle exec cucumber tests/specs/features`
[...] # do stuff with it
puts result

Now the result of the command has these nice c开发者_开发百科olors telling me a lot about passing and failing tests by just looking at it without reading. But: when I put the result like this, the coloring is gone!

Is there any way of doing this without losing the coloring?


Take a look at this and this questions, they are about just the same thing but with rspec instead of cucumber.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜