Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby Rspec outputs literal escape characters on windows

Tags:

ruby

rspec

ansi

I'm following the ruby on rails tutorial: http://railstutorial.org/chapters/static-pages#top

I'm up to using rspec. Having installed the win32console gem, it outputs gibberish in the console, i assume it is outputting the ansi colour change codes:

>rspec spec/
?[31mF?[0m?[31mF?[0m

Finished in 0.34376 seconds
?[31m2 examples, 2 failures?[0m

1) PagesController GET 'home' should be successful
    Failure/Error: Unable to find C to read failed line
    ?[31mundefined method `get' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x22294e0>?[0m
?[90m    # ./spec/controllers/pages_controller_spec.rb:7:in `block (3 levels) in <top (required)>'?[0m

2) PagesController GET 'contact' should be successful
    Failure/Error: Unable to find C to read failed line
    ?[31mundefined method `get' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_2:0x2173d28>?[0m
?[90m    # ./spec/controllers/pages_controller_spec.rb:14:in `block (3 levels) in <top (required)>'?[0m

Any tips how to fix this?

like image 399
Chris Avatar asked Feb 26 '23 11:02

Chris


1 Answers

Ansicon works a treat!

http://adoxa.110mb.com/ansicon/index.html

Download, extract it somewhere, and do:

ansicon -i

Then close/reopen the command prompt. Sweet!

like image 152
Chris Avatar answered Mar 11 '23 07:03

Chris