I am writing some webdriver tests, and have been using pry to step into my tests in order to debug, test, and continue to develop these tests. We recently integrated ci_reporter into our TestUnit framework, which allows us to easily generate an xml results file to hand over to our CI system. Interestingly enough, when ci_reporter is loaded, and the binding.pry is referenced inside one of my methods, upon accessing this command my prompt is stuck in an infinite loop:
TypeError: wrong argument type CI::Reporter::OutputCapture (expected File)
from /home/brian/.rvm/gems/ree-1.8.7-2012.02@reverbnation/gems/pry-0.9.8.2/lib/pry/pry_instance.rb:525:in `readline'
I opened an issue with the ci_reporter developer here: ci-reporter/ci_reporter#55 and he indicates that "ci_reporter overrides and wraps $stdout and $stderr". He wonders if pry is expecting too strict of an instance of File? I was able to get around the issue by returning $stdout, $stderr = STDOUT, STDERR
$stdout, $stderr = STDOUT, STDERR
This is something me and @conradirwin talked about last night, not directly related to this issue but related to other issues that have the same sort of problem. The consensus right now is that we will set our $stdout and $stdin and $stderr unless the user explicitly passes $stdin and $stdout and I'm thinking that we should reset it at the end of our exit.
@bbbco would you be able to create a simple test case for me to play with?
class SimpleTest < Test::Unit::TestCase
@a = 5
@b = 7
Just run the test once to verify the pry bindings work, then uncomment the require 'ci/reporter/rake/test_unit_loader' line and run again to see the infinite loop.
Also, I think it goes without saying to install the gems first, most specifically gem install ci_reporter
gem install ci_reporter
fixed in ci_reporter gem ci-reporter/ci_reporter@e336700