title: How can I make RSpec output to console when run as a command %x[rspec] from Ruby script?
body: <p>I have a class with an instance method that runs RSpec using the <code>%x[]</code> notation:</p>
  
  <pre><code>class TestRunner
    def run_rspec
      # do stuff
      %x[rspec spec -c -f documentation]
      # do more stuff
    end
  end
  </code></pre>
  
  <p>When I do this:</p>
  
  <pre><code>&gt; tr = TestRunner.new
  &gt; tr.run_rspec
  </code></pre>
  
  <p>The documentation (group and example names) does not appear in the console. </p>
  
  <p>To contrast, when I run <code>rspec</code> straight from the command line I get this:</p>
  
  <pre><code>$ rspec spec -c -f documentation
  
    a group name
      an example
      another example
      ...
  </code></pre>
  
  <p>I <strong>don't</strong> want to do this:</p>
  
  <pre><code>puts %x[rspec spec -c -f documentation
  </code></pre>
  
  <p>Because then the output all spits out in one huge clump at the very end. I want it to run in "real time," with each example showing up as each test is run.</p>
  
  <p>Is there a way, with the setup I have, to get RSpec to announce what it's doing, as it's doing it (as it does when run normally from the command line)?</p>