Sha256: 3e7e82ccdd3159dbd17e36b96f4898bc6cb40f36f95b10626bd00871e7677f46

Contents?: true

Size: 1.09 KB

Versions: 32

Compression:

Stored size: 1.09 KB

Contents

# encoding: UTF-8
require 'rubygems'
require 'bundler/setup'
require 'winrm'
require 'json'
require_relative '../matchers'

# Unit test spec helper
module SpecUnitHelper
  def stubbed_response(file)
    File.read("tests/spec/stubs/responses/#{file}")
  end

  def stubbed_clixml(file)
    File.read("tests/spec/stubs/clixml/#{file}")
  end

  def default_connection_opts
    {
      user: 'Administrator',
      password: 'password',
      endpoint: 'http://localhost:5985/wsman',
      max_envelope_size: 153600,
      session_id: '05A2622B-B842-4EB8-8A78-0225C8A993DF',
      operation_timeout: 60,
      locale: 'en-US'
    }
  end
end

# Strip leading whitespace from each line that is the same as the
# amount of whitespace on the first line of the string.
# Leaves _additional_ indentation on later lines intact.
# and remove newlines.
class String
  def unindent
    gsub(/^#{self[/\A[ \t]*/]}/, '').delete("\n")
  end

  def to_byte_string
    force_encoding(Encoding::ASCII_8BIT)
  end
end

RSpec.configure do |config|
  config.include(SpecUnitHelper)
end

Version data entries

32 entries across 29 versions & 3 rubygems

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