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.25.0 spec/type/windows/registry_key_spec.rb
serverspec-2.24.3 spec/type/windows/registry_key_spec.rb
serverspec-2.24.2 spec/type/windows/registry_key_spec.rb
serverspec-2.24.1 spec/type/windows/registry_key_spec.rb
serverspec-2.24.0 spec/type/windows/registry_key_spec.rb
serverspec-2.23.1 spec/type/windows/registry_key_spec.rb
serverspec-2.23.0 spec/type/windows/registry_key_spec.rb
serverspec-2.22.0 spec/type/windows/registry_key_spec.rb
serverspec-2.21.1 spec/type/windows/registry_key_spec.rb
serverspec-2.21.0 spec/type/windows/registry_key_spec.rb
serverspec-2.20.0 spec/type/windows/registry_key_spec.rb
serverspec-2.19.0 spec/type/windows/registry_key_spec.rb
serverspec-2.18.0 spec/type/windows/registry_key_spec.rb
serverspec-2.17.1 spec/type/windows/registry_key_spec.rb
serverspec-2.17.0 spec/type/windows/registry_key_spec.rb
serverspec-2.16.0 spec/type/windows/registry_key_spec.rb
serverspec-2.15.0 spec/type/windows/registry_key_spec.rb
serverspec-2.14.1 spec/type/windows/registry_key_spec.rb
serverspec-2.14.0 spec/type/windows/registry_key_spec.rb
serverspec-2.13.0 spec/type/windows/registry_key_spec.rb