On Mar 10, 5:34 am, Gordon T. [email protected] wrote:
Thanks for your work on this.
handle them. In Windows, the escape codes just get dumped to stdout,
so you have to make sure the current process knows how to handle them.
I hope that makes sense.
It does, however, as I mentioned in the RSpec-dev mailing list post,
trying to recreate it just end prematurely, doesn’t complete.
Ignoring for a second that ZenTest/autospec changes the first two
lines of the autotest rubygem stub, check the following example:
Ruby
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
#gem list:
win32console (1.3.0.beta2, 1.3.0.beta1)
rspec (1.3.0)
ZenTest (4.2.1)
~/.autotest
STDOUT.puts “OUT: THIS IS ~/.autotest file”
STDERR.puts “ERR: THIS IS ~/.autotest file”
require ‘win32console’
puts “$stdout.redirected? #{$stdout.redirected?}”
puts “$stderr.redirected? #{$stderr.redirected?}”
rake-compiler/.autotest
STDOUT.puts “OUT: THIS IS rake-compiler/.autotest file”
STDERR.puts “ERR: THIS IS rake-compiler/.autotest file”
require ‘win32console’
puts “$stdout.redirected? #{$stdout.redirected?}”
puts “$stderr.redirected? #{$stderr.redirected?}”
Running autospec in my folder, output this:
C:\Users\Luis\Projects\oss\rake-compiler>autospec
(Not running features. To run features in autotest, set
AUTOFEATURE=true.)
loading autotest/rspec
OUT: THIS IS ~/.autotest file
ERR: THIS IS ~/.autotest file
$stdout.redirected? false
$stderr.redirected? false
OUT: THIS IS rake-compiler/.autotest file
ERR: THIS IS rake-compiler/.autotest file
$stdout.redirected? false
$stderr.redirected? false
C:\Users\Luis\Tools\Ruby\ruby-1.8.6-p398-i386-mingw32\bin\ruby C:/
Users/Luis/.gem/ruby/x86-mingw32/1.8/gems/rspec-1.3.0/bin/spec –
autospec C:/Users/Luis/Projects/oss/rake-compiler/spec/lib/rake/
javaextensiontask_spec.rb C:/Users/Luis/Projects/oss/rake-compiler/
spec/lib/rake/extensiontask_spec.rb -O spec/spec.opts
And from there beautiful colors (well, not beautiful, but seems it
works).
The following version also works:
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
But NOT 1.9.1:
C:\Users\Luis\Projects\oss\rake-compiler>autospec
loading autotest/rspec
OUT: THIS IS ~/.autotest file
ERR: THIS IS ~/.autotest file
$stdout.redirected? false
$stderr.redirected? false
OUT: THIS IS rake-compiler/.autotest file
ERR: THIS IS rake-compiler/.autotest file
$stdout.redirected? false
$stderr.redirected? false
C:\Users\Luis\Tools\Ruby\ruby-1.9.1-p378-i386-mingw32\bin\ruby C:/
Users/Luis/.gem/ruby/x86-mingw32/1.9.1/gems/rspec-1.3.0/bin/spec –
autospec C:/Users/Luis/Projects/oss/rake-compiler/spec/lib/rake/
extensiontask_spec.rb C:/Users/Luis/Projects/oss/rake-compiler/spec/
lib/rake/javaextensiontask_spec.rb -O spec/spec.opts
Rake::ExtensionTask
#new
(basic)
WARNING: You’re cross-compiling a binary extension for JRuby, but are
using
another interpreter. If your Java classpath or extension dir settings
are not
correctly detected, then either check the appropriate environment
variables or
execute the Rake compilation task using the JRuby interpreter.
(e.g. jruby -S rake compile:java
)
====
Stops there, all without colors.
Now, running rake spec or spec -c spec display all colors too, so is
something around autospec/autotest and Ruby 1.9
====
Hope I explained better this time since seems nobody answered on RSpec-
dev maybe my english wasn’t good enough.
Regards,