Showing with 66 additions and 5 deletions.
  1. +6 −2 CHANGELOG.md
  2. +5 −1 manifests/value.pp
  3. +1 −1 metadata.json
  4. +54 −1 spec/defines/value_spec.rb
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## Unreleased

## [2.0.0] - 2018-01-26
## [2.0.1] - 2018-01-25
### Fixed
- Fix the restrictive typing introduced for the registry::value defined type to once again allow numeric values to be specified for DWORD, QWORD and arrays for REG_MULTI_SZ values ([MODULES-6528](https://tickets.puppetlabs.com/browse/MODULES-6528))

## [2.0.0] - 2018-01-24
### Added
- Add support for Puppet 5 ([MODULES-5144](https://tickets.puppetlabs.com/browse/MODULES-5144))

Expand Down Expand Up @@ -109,4 +113,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [0.1.0] - 2012-05-16
### Added
- Initial release
- Initial release
6 changes: 5 additions & 1 deletion manifests/value.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
Pattern[/^\w+/] $key,
Optional[String] $value = undef,
Optional[Pattern[/^\w+/]] $type = 'string',
Optional[String] $data = undef,
Optional[Variant[
String,
Numeric,
Array[Variant[String]
]]] $data = undef,
) {

# ensure windows os
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-registry",
"version": "2.0.0",
"version": "2.0.1",
"author": "Puppet Inc",
"summary": "This module provides a native type and provider to manage keys and values in the Windows Registry",
"license": "Apache-2.0",
Expand Down
55 changes: 54 additions & 1 deletion spec/defines/value_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,57 @@

it { is_expected.to compile.and_raise_error(/parameter 'type'/) }
end
end

context 'Given a resource with string data' do
let(:params) {{
:key => 'HKLM\Software\Vendor',
:data => 'KingKongBundy'
}}

it { is_expected.to compile }
end

['dword', 'qword'].each do |type|
context "Given a resource with #{type} numeric data" do
let(:params) {{
:key => 'HKLM\Software\Vendor',
:type => type,
:data => 42,
}}

it { is_expected.to compile }
end
end

context 'Given a resource with binary data' do
let(:params) {{
:key => 'HKLM\Software\Vendor',
:type => 'binary',
:data => '1'
}}

it { is_expected.to compile }
end

['string', 'expand'].each do |type|
context "Given a resource with string data typed as '#{type}'" do
let(:params) {{
:key => 'HKLM\Software\Vendor',
:data => 'RavishingRickRude',
:type => type,
}}

it { is_expected.to compile }
end
end

context 'Given a resource with array data' do
let(:params) {{
:key => 'HKLM\Software\Vendor',
:data => ['JakeTheSnake', 'AndreTheGiant'],
:type => 'array',
}}

it { is_expected.to compile }
end
end