Color disappears when using Autotest and Spork #184

Closed
mhartl opened this Issue Oct 11, 2010 · 9 comments

Projects

None yet

4 participants

@mhartl
mhartl commented Oct 11, 2010

With 2.0.0.rc (rspec and rspec-rails), the color shows up fine when using RSpec with Autotest and Spork, but the color disappears when using 2.0.0 final. The weird thing is that rspec spec/ still has color even when the Spork server is running, and Autotest has color when the Spork server isn't running, so it appears to be an interaction between the three parts (RSpec, Autotest, and Spork). But the only thing that has changed is RSpec 2.0.0.rc to 2.0.0, so the issue ultimately must be with the rspec (or rspec-rails) gem.

I'd appreciate any suggestions about how to fix this. My guess is that it is related to commit e68923d, but I'm not sure; please let me know if you need any further information to help diagnose the problem. My setup is described in Chapter 3 of the Ruby on Rails Tutorial, and this is the only thing keeping me from including RSpec 2.0.0 final in the print edition of the book.

@dchelimsky
Member

Pass --autotest over drb to get color to work w/ autotest+spork.

@dchelimsky
Member

Unfortunately, this won't be released for a week or so. What sort of timeline are you on for print?

@mhartl
mhartl commented Oct 11, 2010

Man, you are just too fast! After taking a break I made another run at the code, and came back here essentially to report the fix you implemented.

I'm planning to ship the final files tomorrow (!), but if you can tell me which version of RSpec will have the fix I can put it in now. Will it be 2.0.1?

@dchelimsky
Member

It will be in 2.0.1, but feel free to mention both (i.e. "if you're using rspec-2.0.0, here's a workaround")

Cheers.

@railstutorial

Thanks, David. I launched the PDF using 2.0.0 and the workaround, and put 2.0.1 in the manuscript for the print edition. (If for any reason it doesn't work, I can always fix it in proofs.) Thanks again for all your hard work—RSpec 2.0 is a tremendous milestone.

@lstoldt
lstoldt commented Oct 20, 2010

This doesn't appear to be fixed in 2.0.1.

"rspec spec" works fine, but "rspec -X spec" or "rspec --drb spec" prints out escape sequences instead of color.

@railstutorial

I've installed the fix on my system, and it appears to work. Sometimes having the older RSpec gems floating around causes problems. Try running

$ gem list rspec

and remove everything there that is related to RSpec 2.0.0. This will involve not only rspec and rspec-rails, but also rspec-core, rspec-mocks, and rspec-expectations:

$ gem uninstall rspec-expectations -v 2.0.0

and so on.

@dchelimsky
Member

Thank you for finding that. And wow, that sucks!

@lstoldt
lstoldt commented Oct 21, 2010

That did something weird. When I run rspec --drb spec, all the results appear in the window that is running Spork, and not the command window I ran rspec in. But the colors are correct!

edit: on closer inspection this still fails to render colors in autotest (no --drb). I've removed everything have to do with 2.0.0. If I got the spork output in the right window I'm guessing the colors would also fail.

@timcharper timcharper pushed a commit to timcharper/rspec-core that referenced this issue Aug 19, 2011
@dchelimsky dchelimsky Pass --autotest over drb to get color to work w/ autotest+spork.
- Closes #184.
6e9cba6
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment