Commit 1e4c4ef3 authored by Florian R. Hanke's avatar Florian R. Hanke

[Executable] Also test indentation.

parent 02d4aaa7
......@@ -16,7 +16,7 @@ module Pod
result = mock
result.stubs(:success?).returns(true)
Open3.expects(:popen3).with('/Spa ces/are"/fun/false').once.returns(result)
PTY.expects(:spawn).with('/Spa ces/are"/fun/false').once.returns(result)
Executable.execute_command(cmd, [], true)
end
......@@ -24,10 +24,33 @@ module Pod
cmd = ['-e', <<-RB]
Process.fork { Process.daemon(nil, true); sleep(4) }
puts 'out'
warn 'err'
RB
Timeout.timeout(2) do
Executable.execute_command('ruby', cmd, true).should == "out\n"
Executable.execute_command('ruby', cmd, true).should == "out\r\nerr\r\n"
end
end
it "captures all output by the subprocess" do
cmd = ['-e', <<-RB]
puts 'out'
warn 'err'
p 'p'
print 'print'
RB
Executable.execute_command('ruby', cmd, true).should == "out\r\nerr\r\n\"p\"\r\nprint"
end
it "indents output correctly" do
cmd = ['-e', <<-RB]
puts 'out'
warn 'err'
RB
UI.indentation_level = 4
Executable.execute_command('ruby', cmd, true).should == " out\r\n err\r\n"
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