Commit b071ab7d authored by Florian R. Hanke's avatar Florian R. Hanke

[Executable] Add test to test synchronous output.

parent f377c313
...@@ -52,5 +52,32 @@ module Pod ...@@ -52,5 +52,32 @@ module Pod
Executable.execute_command('ruby', cmd, true).should == " out\r\n err\r\n" Executable.execute_command('ruby', cmd, true).should == " out\r\n err\r\n"
end end
it "outputs as it goes when verbose" do
cmd = ['-e', <<-RB]
puts 'out'
sleep 0.5
warn 'err'
RB
Config.instance.verbose = true
output = StringIO.new
thread = Thread.new { Executable.with_output('ruby', cmd, output) }
# Give Ruby a chance to start.
sleep 0.3
output.string.should == ''
sleep 0.5
output.string.should == "out\r\n"
sleep 0.5
output.string.should == "out\r\nerr\r\n"
end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment