Sha256: 70b101ec1926f0c79c0eae1a3735c441d02dd22baf6d71803eba87d3245648eb

Contents?: true

Size: 1.42 KB

Versions: 90

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'

set :backend, :cmd
set :os, :family => 'windows'

describe windows_registry_key('PATH/TO/THE_KEY') do
  it { should exist }
end

describe windows_registry_key('PATH/TO/THE_KEY') do
  it { should have_value('Test Value') }
end

describe 'Key value types' do
  context 'default type' do
    describe windows_registry_key('PATH/TO/THE_KEY') do
      it { should have_property('TestProperty') }
    end
  end

  {
    :type_string       => 'String',
    :type_binary       => 'Binary',
    :type_dword        => 'DWord',
    :type_qword        => 'QWord',
    :type_multistring  => 'MultiString',
    :type_expandstring => 'ExpandString'
  }.each do |sym, type|
    context "type #{type}" do
      describe windows_registry_key('PATH/TO/THE_KEY') do
        it { should have_property('TestProperty', sym) }
      end
    end
  end
end

describe windows_registry_key('PATH/TO/THE_KEY') do
  it { should have_property_value('TestProperty', :type_binary, '12a07b') }
end

describe windows_registry_key('PATH/TO/THE_KEY') do
  it { should have_property_value('TestProperty', :type_dword, 'fffffd6c') }
end

describe windows_registry_key('PATH/TO/THE_KEY') do
  it { should have_property_value('TestProperty', :type_qword, '1e240') }
end

describe windows_registry_key('PATH/TO/THE_KEY') do
  it {
    value = <<-EOF
test line1
test line2
test line3
EOF
    should have_property_value('TestProperty', :type_multistring, value)
  }
end

Version data entries

90 entries across 90 versions & 4 rubygems

Version Path
serverspec-2.38.0 spec/type/windows/registry_key_spec.rb
serverspec-2.37.2 spec/type/windows/registry_key_spec.rb
serverspec-2.37.1 spec/type/windows/registry_key_spec.rb
serverspec-2.37.0 spec/type/windows/registry_key_spec.rb
serverspec-2.36.1 spec/type/windows/registry_key_spec.rb
serverspec-2.36.0 spec/type/windows/registry_key_spec.rb
serverspec-2.35.0 spec/type/windows/registry_key_spec.rb
serverspec-2.34.0 spec/type/windows/registry_key_spec.rb
serverspec-2.33.0 spec/type/windows/registry_key_spec.rb
serverspec-2.32.0 spec/type/windows/registry_key_spec.rb
serverspec-2.31.1 spec/type/windows/registry_key_spec.rb
serverspec-2.31.0 spec/type/windows/registry_key_spec.rb
serverspec-2.30.1 spec/type/windows/registry_key_spec.rb
serverspec-2.30.0 spec/type/windows/registry_key_spec.rb
serverspec-2.29.2 spec/type/windows/registry_key_spec.rb
serverspec-2.29.1 spec/type/windows/registry_key_spec.rb
serverspec-2.29.0 spec/type/windows/registry_key_spec.rb
serverspec-2.28.0 spec/type/windows/registry_key_spec.rb
serverspec-2.27.0 spec/type/windows/registry_key_spec.rb
serverspec-2.26.0 spec/type/windows/registry_key_spec.rb