Class: Serverspec::Type::WindowsRegistryKey

Inherits:
Base
  • Object
show all
Defined in:
lib/serverspec/type/windows_registry_key.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_ary, #to_s

Constructor Details

This class inherits a constructor from Serverspec::Type::Base

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)

4
5
6
# File 'lib/serverspec/type/windows_registry_key.rb', line 4

def exists?
  backend.check_registry_key(@name)
end

#has_property?(property_name, property_type = :type_string) ⇒ Boolean

Returns:

  • (Boolean)

8
9
10
# File 'lib/serverspec/type/windows_registry_key.rb', line 8

def has_property?(property_name, property_type = :type_string)
  backend.check_registry_key(@name, {:name => property_name, :type => property_type})
end

#has_property_value?(property_name, property_type, value) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/serverspec/type/windows_registry_key.rb', line 16

def has_property_value?(property_name, property_type, value)
  backend.check_registry_key(@name, {:name => property_name, :type => property_type, :value => value})
end

#has_value?(value) ⇒ Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/serverspec/type/windows_registry_key.rb', line 12

def has_value?(value)
  backend.check_registry_key(@name, {:name => '', :type => :type_string, :value => value})
end