Sha256: a581be2af2e295e5e9de75f740b4afd3729270a3854b784886e19367178db6dd

Contents?: true

Size: 1022 Bytes

Versions: 25

Compression:

Stored size: 1022 Bytes

Contents

# encoding: UTF-8
require_relative 'spec_helper'

describe 'winrm client wql' do
  before(:all) do
    @winrm = winrm_connection
  end

  it 'should query Win32_OperatingSystem' do
    output = @winrm.run_wql('select * from Win32_OperatingSystem')
    expect(output).to_not be_empty
    output_caption = output[:win32_operating_system][0][:caption]
    expect(output_caption).to include('Microsoft')
    expect(output_caption).to include('Windows')
  end

  it 'should query Win32_Process' do
    output = @winrm.run_wql('select * from Win32_Process')
    expect(output).to_not be_empty
    process_count = output[:win32_process].count
    expect(process_count).to be > 1
    expect(output[:win32_process]).to all(include(:command_line))
  end

  it 'should query Win32_Process with block' do
    count = 0
    @winrm.run_wql('select * from Win32_Process') do |type, item|
      expect(type).to eq(:win32_process)
      expect(item).to include(:command_line)
      count += 1
    end
    expect(count).to be > 1
  end
end

Version data entries

25 entries across 22 versions & 3 rubygems

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