Cucumber ast table output #751

Closed
kalys opened this Issue Nov 14, 2012 · 3 comments

3 participants

@kalys

Hello. While printing cucumber ast::table I've got this:

pry(#<Cucumber::Rails::World>)> params
=> 
  | [0m[32m    search[0m[0m[0m[0m |[0m[0m [0m[32m    aoeuaoeuaoeu[0m[0m[0m[0m |[0m[0m

instead of colorized

| search | aoeuaoeuaoeu |

I'm not sure if this is bug of pry or cucumber. Let me know, please.

@ConradIrwin
pry member

@kalys, what's the value of params.inspect? it looks like the problem could be that there are colour codes in the params that we don't support very well.

@kalys

@ConradIrwin

[1] pry(#<Cucumber::Rails::World>)> params.inspect
=> "\n  | \e[32m    author\e[0m\e[0m |\e[0m \e[32m    123\e[0m\e[0m |\e[0m\n"
@AndrewVos

This line of code in Cucumber https://github.com/cucumber/cucumber/blob/master/lib/cucumber/ast/table.rb#L445 is causing the ANSI colour code output.

This is not really a bug in Cucumber, but because Cucumber overrides to_s to display coloured output we are seeing that.

Maybe create an issue in Cucumber asking to not use to_s and switch to something like "output_string" or something more sensible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment