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.42.3 spec/type/windows/registry_key_spec.rb
serverspec-2.42.2 spec/type/windows/registry_key_spec.rb
serverspec-2.42.1 spec/type/windows/registry_key_spec.rb
serverspec-cem-acpt-2.42.0 spec/type/windows/registry_key_spec.rb
serverspec-2.42.0 spec/type/windows/registry_key_spec.rb
serverspec-2.41.8 spec/type/windows/registry_key_spec.rb
serverspec-2.41.7 spec/type/windows/registry_key_spec.rb
serverspec-2.41.6 spec/type/windows/registry_key_spec.rb
serverspec-2.41.5 spec/type/windows/registry_key_spec.rb
serverspec-2.41.4 spec/type/windows/registry_key_spec.rb
serverspec-ruby19-2.24.3 spec/type/windows/registry_key_spec.rb
serverspec-2.41.3 spec/type/windows/registry_key_spec.rb
serverspec-2.41.2 spec/type/windows/registry_key_spec.rb
serverspec-2.41.1 spec/type/windows/registry_key_spec.rb
serverspec-2.41.0 spec/type/windows/registry_key_spec.rb
serverspec-2.40.0 spec/type/windows/registry_key_spec.rb
serverspec-2.39.2 spec/type/windows/registry_key_spec.rb
serverspec-2.39.1 spec/type/windows/registry_key_spec.rb
serverspec-2.39.0 spec/type/windows/registry_key_spec.rb
serverspec-2.38.1 spec/type/windows/registry_key_spec.rb