diff --git a/CHANGELOG.md b/CHANGELOG.md index 10ca4f08..aea33519 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ appear at the top. * Add your entries here, remember to credit yourself however you want to be credited! + * Remove strip from capture to preserve whitespace. Nick Townsend * Add vmware_fusion Vagrant provider. Nick Townsend ## 1.5.1 diff --git a/lib/sshkit/backends/local.rb b/lib/sshkit/backends/local.rb index af873730..ad1fa375 100644 --- a/lib/sshkit/backends/local.rb +++ b/lib/sshkit/backends/local.rb @@ -28,7 +28,7 @@ def execute(*args) def capture(*args) options = { verbosity: Logger::DEBUG }.merge(args.extract_options!) - _execute(*[*args, options]).full_stdout.strip + _execute(*[*args, options]).full_stdout end private diff --git a/test/functional/backends/test_local.rb b/test/functional/backends/test_local.rb index c9a0f785..d4a8bf18 100644 --- a/test/functional/backends/test_local.rb +++ b/test/functional/backends/test_local.rb @@ -14,7 +14,7 @@ def test_capture Local.new do captured_command_result = capture(:echo, 'foo') end.run - assert_equal 'foo', captured_command_result + assert_equal "foo\n", captured_command_result end def test_execute_raises_on_non_zero_exit_status_and_captures_stdout_and_stderr