# encoding: UTF-8 require 'winrm/wsmv/create_shell' describe WinRM::WSMV::CreateShell do context 'default session options' do subject { described_class.new(default_connection_opts) } let(:xml) { subject.build } it 'creates a well formed message' do expect(xml).to include('PT60S') expect(xml).to include('') expect(xml).to include('') expect(xml).to include( '' \ 'uuid:05A2622B-B842-4EB8-8A78-0225C8A993DF') expect(xml).to include('153600') expect(xml).to include('http://localhost:5985/wsman') expect(xml).to include('stdin') expect(xml).to include('stdout stderr') expect(xml).to include( '' \ 'http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd') end context 'shell options w/env vars' do let(:shell_opts) do { env_vars: { 'FOO' => 'BAR' } } end subject { described_class.new(default_connection_opts, shell_opts) } let(:xml) { subject.build } it 'includes environemt vars' do expect(xml).to include( 'BAR') end end end end