Sha256: 7acdb0f5e4d9efeb030ee22a2e4f75417db9579cd3f3732e5615ef700ebc1135

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

# encoding: UTF-8
require_relative 'spec_helper'

describe 'issue 59' do
  describe 'long running script without output' do
    let(:logged_output) { StringIO.new }
    let(:logger)        { Logging.logger(logged_output) }

    before do
      opts = connection_opts.dup
      opts[:operation_timeout] = 1
      conn = WinRM::Connection.new(opts)
      conn.logger = logger
      @powershell = conn.shell(:powershell)
    end

    it 'should not error' do
      out = @powershell.run('$ProgressPreference="SilentlyContinue";sleep 3; Write-Host "Hello"')

      expect(out).to have_exit_code 0
      expect(out).to have_stdout_match(/Hello/)
      expect(out).to have_no_stderr
      expect(logged_output.string).to match(/retrying receive request/)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
winrm-2.1.0 tests/integration/issue_59_spec.rb