rspec-puppet-utils 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/lib/hieradata/validator.rb +1 -1
- data/lib/hieradata/yaml_validator.rb +2 -1
- data/rspec-puppet-utils.gemspec +1 -1
- data/spec/classes/hieradata/yaml_validator_spec.rb +4 -0
- data/spec/fixtures/hieradata/valid/sub/nested.dot.yaml +2 -0
- data/spec/spec_helper.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
data.tar.gz: 9c4d6d2970af159ab900e47f39b656d0fef11739
|
4
|
+
metadata.gz: 946d6dec16dcfa5ee307065eea16b1b84dc6aaa8
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
data.tar.gz: 8e7d528ea6255a1c00b5a7ba4d2eccf4fbe88fc2781f49847a7eb9f9bed4056561319783dfb1badb3c2a2c30f6b8443a4baaf6c7a87fe28ba806332b676551b9
|
7
|
+
metadata.gz: 4438ee69a987e4ebcbf9201a3d094b5cc18f399b424ee4274c5646191e06ac33aa176022351a9621b26b90ede7ecc2b32bd3fddc121f8d20fce5086e56c9f99e
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/lib/hieradata/validator.rb
CHANGED
@@ -30,7 +30,7 @@ module RSpecPuppetUtils
|
|
30
30
|
begin
|
31
31
|
required_files.delete file
|
32
32
|
block.call @data[file][matched_key]
|
33
|
-
rescue
|
33
|
+
rescue RSpec::Expectations::ExpectationNotMetError => e
|
34
34
|
raise ValidationError, "#{matched_key} is invalid in #{file}: #{e.message}"
|
35
35
|
end
|
36
36
|
end
|
@@ -31,7 +31,8 @@ module RSpecPuppetUtils
|
|
31
31
|
|
32
32
|
def load_data_for_file(file, ignore_empty)
|
33
33
|
# Assume all file names are unique i.e. thing.yaml and thing.yml don't both exist
|
34
|
-
|
34
|
+
# Allow dots in filename i.e. thing.something.yaml
|
35
|
+
file_name = File.basename(file, File.extname(file))
|
35
36
|
begin
|
36
37
|
yaml = File.open(file) { |yf| YAML::load( yf ) }
|
37
38
|
rescue ArgumentError => e
|
data/rspec-puppet-utils.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |gem|
|
3
3
|
gem.name = 'rspec-puppet-utils'
|
4
|
-
gem.version = '2.0.
|
4
|
+
gem.version = '2.0.5'
|
5
5
|
gem.description = 'Helper classes for mock/stub functions, templates and hierdata'
|
6
6
|
gem.summary = ''
|
7
7
|
gem.author = 'Tom Poulton'
|
@@ -29,6 +29,10 @@ describe HieraData::YamlValidator do
|
|
29
29
|
expect(validator.data[:valid]['string-value']).to eq 'a string'
|
30
30
|
end
|
31
31
|
|
32
|
+
it 'should load yaml data from files with dot in filename' do
|
33
|
+
expect(validator.data.keys).to include :'nested.dot'
|
34
|
+
end
|
35
|
+
|
32
36
|
it 'should not add any load errors' do
|
33
37
|
expect(validator.load_errors).to be_an Array
|
34
38
|
expect(validator.load_errors).to be_empty
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-puppet-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Poulton
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2015-01-06 00:00:00 Z
|
13
13
|
dependencies: []
|
14
14
|
|
15
15
|
description: Helper classes for mock/stub functions, templates and hierdata
|
@@ -40,6 +40,7 @@ files:
|
|
40
40
|
- spec/fixtures/hieradata/empty/not_empty.yaml
|
41
41
|
- spec/fixtures/hieradata/invalid/invalid.yaml
|
42
42
|
- spec/fixtures/hieradata/valid/other.foo
|
43
|
+
- spec/fixtures/hieradata/valid/sub/nested.dot.yaml
|
43
44
|
- spec/fixtures/hieradata/valid/sub/nested.yaml
|
44
45
|
- spec/fixtures/hieradata/valid/valid.yaml
|
45
46
|
- spec/fixtures/templates/returns_elephant.erb
|
@@ -80,6 +81,7 @@ test_files:
|
|
80
81
|
- spec/fixtures/hieradata/empty/not_empty.yaml
|
81
82
|
- spec/fixtures/hieradata/invalid/invalid.yaml
|
82
83
|
- spec/fixtures/hieradata/valid/other.foo
|
84
|
+
- spec/fixtures/hieradata/valid/sub/nested.dot.yaml
|
83
85
|
- spec/fixtures/hieradata/valid/sub/nested.yaml
|
84
86
|
- spec/fixtures/hieradata/valid/valid.yaml
|
85
87
|
- spec/fixtures/templates/returns_elephant.erb
|