<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Chris Pratt - Latest Comments in Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://chrisdpratt.disqus.com/</link><description></description><language>en</language><lastBuildDate>Tue, 02 Dec 2008 20:47:34 -0000</lastBuildDate><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969653</link><description>I've followed tips here and on other sites and I still always end up with the following when I run the autotest cmd:&lt;br&gt;&lt;br&gt;loading autotest/rails&lt;br&gt;&lt;br&gt;and then it hangs up.&lt;br&gt;&lt;br&gt;I've also tried "autotest | ruby ansipipe.rb" as suggested above. I dont get the loading msg, but it still just seems to hang.&lt;br&gt;&lt;br&gt;I'm on Vista and running rails 1.2.6... does anybody have any odeas?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zaj</dc:creator><pubDate>Tue, 02 Dec 2008 20:47:34 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969652</link><description>Following the example above, to get autotest to output with color, without hacking released files:&lt;br&gt;—–&lt;br&gt;I put the following in my .autotest:&lt;br&gt;require 'Win32/Console/ANSI'&lt;br&gt;—–&lt;br&gt;I never had any issues getting autotest or snarl to work.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bryan</dc:creator><pubDate>Wed, 24 Sep 2008 20:50:34 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969649</link><description>vknightbd had the right idea, but my snarl worked fine as is, the only thing I had to do based on what he wrote was:&lt;br&gt;-----&lt;br&gt;add the following to the top of ZenTest-3.9.2\lib\autotest.rb (for color)&lt;br&gt;require ‘Win32/Console/ANSI’ if RUBY_PLATFORM =~ /win32/&lt;br&gt;-----&lt;br&gt;&lt;br&gt;Doing the first step with the rubygem actually created 3 errors when running auto test (saying that rubygem was already included or something like that)&lt;br&gt;and I didn't do the bottom two steps because like I said, snarl was working fine for me.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anlek</dc:creator><pubDate>Wed, 11 Jun 2008 11:20:33 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969650</link><description>I also managed to hack it so that I got colored autotest and snarl to work outside of cygwin for rspec-1.1.4, zentest-3.9.2, win32console-1.0.8&lt;br&gt;&lt;br&gt;change the require in line 130 from 'rubygems' to 'RubyGems' in rspec-1.1.4\lib\spec\runner\options.rb (not sure if this is significant)&lt;br&gt;&lt;br&gt;add the following to the top of ZenTest-3.9.2\lib\autotest.rb (for color)&lt;br&gt;require 'Win32/Console/ANSI' if RUBY_PLATFORM =~ /win32/&lt;br&gt;&lt;br&gt;Snarl is broken since ZenTest is not parsing Rspec's output correctly.&lt;br&gt;&lt;br&gt;replace the following regex in the initialize method in autotest.rb to match the Rspec output.&lt;br&gt;    self.completed_re = /\d+ examples(, \d+ failures)?(, \d+ pending)?/&lt;br&gt;    self.failed_results_re = /^\s*\d+\)\s*[^\n]*(?:Failed|Error)[^\n]*\n([^\n]*)\n([^\n]*):\d+:/i #ugly&lt;br&gt;&lt;br&gt;replace the consolidate_failures method in autotest.rb (or in my case, merb_rspec.rb) to use the new array generated by the above failed_results_re.&lt;br&gt;  def consolidate_failures(failed)&lt;br&gt;    filters = Hash.new { |h,k| h[k] = [] }&lt;br&gt;    failed.each{|error_message, spec_file| filters[spec_file] &amp;lt;&amp;lt; error_message}&lt;br&gt;    return filters&lt;br&gt;  end&lt;br&gt;&lt;br&gt;I also made some extra changes to ZenTest-3.9.2\lib\autotest\snarl.rb and modified the red hook and added an all_good hook.&lt;br&gt;  Autotest.add_hook :red do |at|&lt;br&gt;    failed_tests = at.files_to_test.inject(0){ |s,a| k,v = a;  s + v.size}&lt;br&gt;    failed_files = at.files_to_test.size&lt;br&gt;    snarl "Tests Failed", "#{failed_tests} tests failed of #{failed_files} specs tested.", :red&lt;br&gt;  end&lt;br&gt;  Autotest.add_hook :all_good do |at|&lt;br&gt;    snarl "All Tests Passed", "Tests have fully passed", :green&lt;br&gt;  end</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vknightbd</dc:creator><pubDate>Fri, 30 May 2008 08:50:26 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969651</link><description>Hi,&lt;br&gt;&lt;br&gt;Using rSpec and Zentest as of today's version, I am having the same problems: no color in the shell, and snarl telling me that all tests pass when they do not... And moreover the tests are quite slow compared to OSX or Linux boxes...</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Thomas G.</dc:creator><pubDate>Wed, 13 Feb 2008 16:03:03 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969648</link><description>Looks like in rspec 1.1.1, darelf's hack to base_text_formatter.rb has been moved to .\vendor\plugins\rspec\lib\spec\runner\options.rb around line 104</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Foley</dc:creator><pubDate>Fri, 11 Jan 2008 22:57:23 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969647</link><description>i succeeded in having colored autotest output and snarl popups in Windows (not cygwin) with next raugh steps:&lt;br&gt;&lt;br&gt;content for .\.autotest&lt;br&gt;        require ‘autotest/snarl’&lt;br&gt;&lt;br&gt;content for .\ansipipe.rb&lt;br&gt;        require 'rubygems'&lt;br&gt;        require 'win32console'&lt;br&gt;        @io = Win32::Console::ANSI::IO.new()&lt;br&gt;        until $stdin.eof? do&lt;br&gt;           line = $stdin.gets&lt;br&gt;           @io.puts line&lt;br&gt;        end&lt;br&gt;        @io.flush&lt;br&gt;&lt;br&gt;in .\vendor\plugins\rspec\lib\spec\runner\formatter\base_text_formatter.rb hack method colour=&lt;br&gt;          def colour=(colour)&lt;br&gt;             @colour = colour&lt;br&gt;# winhack&lt;br&gt;#          begin&lt;br&gt;#            require 'Win32/Console/ANSI' if @colour &amp;amp;&amp;amp; PLATFORM =~ /win32/&lt;br&gt;#	  rescue LoadError ;&lt;br&gt;#	    raise "You must gem install win32console to use colour on Windows"&lt;br&gt;#	  end&lt;br&gt;        end&lt;br&gt;&lt;br&gt;`snarl` must be installed.&lt;br&gt;Gems: `win32console`, `diff-lcs`, `ruby-snarl` must be installed.&lt;br&gt;`Redgreen` gem is not needed.&lt;br&gt;`ruby` and `rake` must be included in $PATH&lt;br&gt;&lt;br&gt;run autotest from the root of project in command line as:&lt;br&gt;       autotest | ruby ansipipe.rb&lt;br&gt;&lt;br&gt;not delicate but it works for me</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">darelf</dc:creator><pubDate>Tue, 13 Nov 2007 00:04:32 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969646</link><description>One more to hate windows and autotest (not) working together.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vitor</dc:creator><pubDate>Mon, 08 Oct 2007 12:53:51 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969645</link><description>Same goes here,&lt;br&gt;&lt;br&gt;I get too many errors when I tried to get autotest to run on Windows.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jamal</dc:creator><pubDate>Sun, 07 Oct 2007 07:39:18 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969644</link><description>The bug is in autotest, in a method that it uses to construct the path to the ruby executable.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wes Gamble</dc:creator><pubDate>Mon, 24 Sep 2007 19:19:14 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969643</link><description>I discovered that my autotest was not actually running the specs because of a problem with the way that they were being called.  That is, if I ran autotest, it would construct appropriate spec commands but they they wouldn't actually be run.  Running the exact same spec command in a command window would work fine.&lt;br&gt;&lt;br&gt;Turns out the command to run the spec commands looks like:&lt;br&gt;&lt;br&gt;c:\ruby\bin\ruby -S script/spec --options spec/spec.opts  spec/helpers/admin_hel&lt;br&gt;per_spec.rb spec/models/evaluation_request_spec.rb spec/models/right_spec.rb spe&lt;br&gt;c/controllers/admin_controller_spec.rb spec/models/person_spec.rb&lt;br&gt;&lt;br&gt;In autotest.rb line 209 (ZenTest 3.6.1), we see:&lt;br&gt;&lt;br&gt;open("| #{cmd}", "r") do |f| ...&lt;br&gt;&lt;br&gt;This is how autotest actually executes the spec command.  Turns out that the single \ characters will causes this command to fail.  Testing with irb, I found that changing the \ to / or escaping the \ with another \ would allow this to work.&lt;br&gt;&lt;br&gt;I don't know yet whether this is a bug in autotest or whether autotest is relying on something lower level to generate the path to the ruby executable.  But either way the command needs to be constructed in such a way that it can be executed.&lt;br&gt;&lt;br&gt;I will post anything more if I find it here.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">weyus</dc:creator><pubDate>Sun, 23 Sep 2007 16:45:21 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969642</link><description>Hmmm.  I see the same thing.  What I notice is that autotest --rails and rake spec are clearly not doing the same thing.  While I am on the verge of buying a Mac anyway because my system is so fscking slow, I'd like to try and power through this because it feels like it should be debuggable.  I'll post any findings.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">weyus</dc:creator><pubDate>Fri, 21 Sep 2007 12:02:14 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969641</link><description>Since, I wrote this post, I revisited setting up my Windows environment one last time (I purchased e-Text Editor, a TextMate clone for windows, and would love to be able to actually use it). This time, however, I approached it from a different standpoint, using Cygwin.&lt;br&gt;&lt;br&gt;With Cygwin, I am able to have autotest happily running my specs with colored output. The only thing missing is Snarl integration, but 1) I'm not sure if it's even possible to integrate Snarl with Cygwin and 2) I'm not sure where to begin if it is.&lt;br&gt;&lt;br&gt;Nevertheless, this has allowed me to productively use Windows for Rails development, for the most part. Everything still runs slower than in Linux and OSX, but having TextMate like functionality makes up for that.&lt;br&gt;&lt;br&gt;Anyways, since others seem to be having the same issues setting up Cygwin properly can be a bit tricky, I think I'll be posting about it real quick here. I'll try to get something out tonight or tomorrow.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">chrisdpratt</dc:creator><pubDate>Sun, 16 Sep 2007 22:39:30 -0000</pubDate></item><item><title>Re: Rails, RSpec, Autotest, Redgreen, and Snarl: Reasons I don&amp;#8217;t like Windows</title><link>http://www.chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/#comment-4969640</link><description>I am also at the ready to abandon Windows for rails development for the same reason.  I've spent 3 days trying to get this setup working and I'm not even this far.  I can't even get autotest to run.  When I try I get an error that makes it seem like autotest can't find my test files even though they are there and running "rake test" works perfectly.&lt;br&gt;&lt;br&gt;I uninstalled everything and started with ruby 1.8.6 and installed the same versions of everything else you are using here.  I execute "rails test_site" then "ruby script/generate scaffold person" to get some test files and when I run autotest I get the following.&lt;br&gt;&lt;br&gt;loading autotest/rails&lt;br&gt;c:\ruby\bin\ruby -I.;lib;test -rtest/unit -e "%w[test/unit/person_test.rb].each { |f| require f }" | unit_diff -u&lt;br&gt;c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- test/unit/person_test.rb (LoadError)&lt;br&gt;        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'&lt;br&gt;        from -e:1&lt;br&gt;        from -e:1:in `each'&lt;br&gt;        from -e:1&lt;br&gt;&lt;br&gt;I'm pleading with my boss to get me a mac, I even told him I would come in and set it up on the weekend, but if that proves fruitless, I would at least like to get autotest working even if I can't have nice gui notifications or colored text.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris</dc:creator><pubDate>Fri, 14 Sep 2007 17:10:03 -0000</pubDate></item></channel></rss>