Sha256: a77bf8e1060da1e344dca6357c8cb2748e1d233a6d0fd5a74afe6844df127d8b

Contents?: true

Size: 1.3 KB

Versions: 30

Compression:

Stored size: 1.3 KB

Contents

# encoding: UTF-8

require 'winrm/psrp/message_data/base'
require 'winrm/psrp/message_data/pipeline_state'

describe WinRM::PSRP::MessageData::PipelineState do
  let(:test_data_xml_template) do
    ERB.new(stubbed_clixml('pipeline_state.xml.erb'))
  end
  let(:pipeline_state) { WinRM::PSRP::MessageData::PipelineState::FAILED }
  let(:error_message) { 'an error occured' }
  let(:category_message) { 'category message' }
  let(:error_id) { 'an error occured' }
  let(:raw_data) { test_data_xml_template.result(binding) }
  subject { described_class.new(raw_data) }

  it 'returns the state' do
    expect(subject.pipeline_state).to eq(pipeline_state)
  end

  it 'returns the exception' do
    expect(subject.exception_as_error_record.exception[:message]).to eq(error_message)
  end

  it 'returns the FullyQualifiedErrorId' do
    expect(subject.exception_as_error_record.fully_qualified_error_id).to eq(error_id)
  end

  it 'returns the error category message' do
    expect(subject.exception_as_error_record.error_category_message).to eq(category_message)
  end

  context 'state is not failed' do
    let(:pipeline_state) { WinRM::PSRP::MessageData::PipelineState::COMPLETED }

    it 'has a nil exception' do
      expect(subject.exception_as_error_record).to be(nil)
    end
  end
end

Version data entries

30 entries across 27 versions & 3 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.1.4.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.1.2.0 vendor/bundle/ruby/2.3.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.1.1.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.0.4.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.0.3.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.5.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.0.2.0 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.0.1.0 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-2.0.0.1 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-1.9.8.1 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb
vagrant-unbundled-1.9.7.1 vendor/bundle/ruby/2.4.0/gems/winrm-2.2.3/tests/spec/psrp/message_data/pipeline_state_spec.rb