Sha256: affe10878fae38d96676c853f7f3f01f764af5dee197faa7e1bd256d4fad6e6d
Contents?: true
Size: 1.86 KB
Versions: 1
Compression:
Stored size: 1.86 KB
Contents
# encoding: UTF-8 require 'winrm/wsmv/command_output' require 'winrm/wsmv/header' describe WinRM::WSMV::CommandOutput do context 'default session options' do let(:cmd_out_opts) do { shell_id: 'F4A2622B-B842-4EB8-8A78-0225C8A993DF', command_id: 'A2A2622B-B842-4EB8-8A78-0225C8A993DF' } end subject { described_class.new(default_connection_opts, cmd_out_opts) } let(:xml) { subject.build } it 'creates a well formed message' do expect(xml).to include('<w:OperationTimeout>PT60S</w:OperationTimeout>') expect(xml).to include('<w:Option Name="WSMAN_CMDSHELL_OPTION_KEEPALIVE">TRUE</w:Option>') expect(xml).to include('w:ResourceURI mustUnderstand="true">' \ 'http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI>') expect(xml).to include('<rsp:DesiredStream ' \ 'CommandId="A2A2622B-B842-4EB8-8A78-0225C8A993DF">stdout stderr</rsp:DesiredStream>') end end context 'powershell' do let(:cmd_out_opts) do { shell_id: 'F4A2622B-B842-4EB8-8A78-0225C8A993DF', command_id: 'A2A2622B-B842-4EB8-8A78-0225C8A993DF', shell_uri: WinRM::WSMV::Header::RESOURCE_URI_POWERSHELL, out_streams: %w(stdout) } end subject { described_class.new(default_connection_opts, cmd_out_opts) } let(:xml) { subject.build } it 'creates a well formed message' do expect(xml).to include('<w:OperationTimeout>PT60S</w:OperationTimeout>') expect(xml).to include('<w:Option Name="WSMAN_CMDSHELL_OPTION_KEEPALIVE">TRUE</w:Option>') expect(xml).to include('w:ResourceURI mustUnderstand="true">' \ 'http://schemas.microsoft.com/powershell/Microsoft.PowerShell</w:ResourceURI>') expect(xml).to include('<rsp:DesiredStream ' \ 'CommandId="A2A2622B-B842-4EB8-8A78-0225C8A993DF">stdout</rsp:DesiredStream>') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
winrm-2.1.0 | tests/spec/wsmv/command_output_spec.rb |