luislavena / win32console

DEPRECATED: Mirror of Win32::Console Gem project with improved MinGW support
http://rubyforge.org/projects/winconsole/
22 stars 11 forks source link

doesn't work with autospec #3

Closed voxik closed 14 years ago

voxik commented 14 years ago

Hello,

This example http://gist.github.com/265593 works just fine with 1.3 beta1 on my W7. However, any time I'm trying to run my RSpec suit with --colour flag and win32console required in .autotest file, it silently fails. I.e. no message, nothing.

C:>ruby -v ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

C:>gem list

* LOCAL GEMS *

actionmailer (2.3.5) actionpack (2.3.5) activerecord (2.3.5) activeresource (2.3.5) activesupport (2.3.5) gemcutter (0.3.0) hoe (2.5.0) json_pure (1.2.0) rack (1.0.1) rails (2.3.5) rake (0.8.7) rspec (1.3.0) rspec-rails (1.3.1) rubyforge (2.0.3) sqlite3-ruby (1.2.5) test-unit (1.2.3) win32console (1.3.0.beta1) ZenTest (4.2.1)

Vit

luislavena commented 14 years ago

Hello, thank you for your report.

The following is my environment and my results:

http://gist.github.com/275927

Seems that more than a win32console problem is the combination of 1.9, win32console, rspec and ZenTest.

Running spec command directly and forcing color works as expected.

I noticed that the command line created by autospec do not load rubygems, and even if autotest file contained require 'win32console', is not being forwarded or appended to the command that really executes your specs:

http://gist.github.com/275932

If this problem can be reproduced with older version of win32console, then we are in trouble.

Please add a spec.opts file and indicate there --colour option, and let me know if that helps.

voxik commented 14 years ago

I'm using following spec.opts:

--colour --format progress --loadby mtime --reverse

i.e. the default spec.opts generated by RSpec. Running "rake spec" works as expected, colors are shown.

Then running autospec, test runs fine, just instead of colors the raw ANSI characters are shown. Therefore I added .autotest file with require 'win32console' and from this moment autospec silently aborts.

luislavena commented 14 years ago

For sake of curiosity can you tell me which codepage is your console using?

To know that, execute "chcp" in the command line.

voxik commented 14 years ago

C:>chcp Aktivní znaková stránka: 852

luislavena commented 14 years ago

ok, seems that codepage is not the root of the issue.

I was able to reproduce it locally. It only enters in effect when console console is being redirected (that is the actual spec running inside another rruby process)

Working on this right now.

charlesroper commented 14 years ago

Can confirm I can also reproduce:

https://rspec.lighthouseapp.com/projects/5645/tickets/961-autospec-on-windows-fails-to-display-colours

luislavena commented 14 years ago

Confirmed and fixed by Gordon Thiesfeld, merged in 0e7b02584afd4ac739187262704a1ea0aba7ee21