test/unit/backends/test_printer.rb in sshkit-0.0.4 vs test/unit/backends/test_printer.rb in sshkit-0.0.5
- old
+ new
@@ -25,15 +25,13 @@
def printer
Printer.new(Host.new(:'example.com'), &block_to_run)
end
def test_simple_printing
- sio = StringIO.new
- SSHKit.capture_output(sio) do
+ result = String.new
+ SSHKit.capture_output(result) do
printer.run
end
- sio.rewind
- result = sio.read
assert_equal <<-EOEXPECTED.unindent, result
if test ! -d /opt/sites/example.com; then echo "Directory does not exist '/opt/sites/example.com'" 1>&2; false; fi
cd /opt/sites/example.com && /usr/bin/env date
cd /opt/sites/example.com && /usr/bin/env ls -l /some/directory
if test ! -d /opt/sites/example.com/tmp; then echo "Directory does not exist '/opt/sites/example.com/tmp'" 1>&2; false; fi