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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dade7bb417a5a0a9d0729271ec800230452f8193
4
- data.tar.gz: db8ed24e66fb1ccd37b6e3d176cc2c0bd6865ce5
3
+ data.tar.gz: 9c4d6d2970af159ab900e47f39b656d0fef11739
4
+ metadata.gz: 946d6dec16dcfa5ee307065eea16b1b84dc6aaa8
5
5
  SHA512:
6
- metadata.gz: 33be8cf25d66aeeffd71ab9ffcbebd275c97d47511844577457c4e77fbeec59f83f9d7f45d008c39a4915c1c6391069a693f711d3a28a2ef3de8f9de282fb002
7
- data.tar.gz: 29869351c54ecfacfefe580b1d2f29c645d537c0ff617437fb227cea172b0fc18cfe6a8ca0f9567bb92391e2a3d63280969093a9c0d2ba8e7a04bb2383562069
6
+ data.tar.gz: 8e7d528ea6255a1c00b5a7ba4d2eccf4fbe88fc2781f49847a7eb9f9bed4056561319783dfb1badb3c2a2c30f6b8443a4baaf6c7a87fe28ba806332b676551b9
7
+ metadata.gz: 4438ee69a987e4ebcbf9201a3d094b5cc18f399b424ee4274c5646191e06ac33aa176022351a9621b26b90ede7ecc2b32bd3fddc121f8d20fce5086e56c9f99e
data/.gitignore CHANGED
@@ -3,4 +3,5 @@
3
3
  .ruby-version
4
4
  .ruby-gemset
5
5
  Gemfile.lock
6
+ .bundle
6
7
  pkg
data/Gemfile CHANGED
@@ -5,3 +5,4 @@ gem 'mocha'
5
5
  gem 'rspec'
6
6
  gem 'rspec-puppet'
7
7
  gem 'puppetlabs_spec_helper'
8
+ gem 'thor'
@@ -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 StandardError => e
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
- file_name = File.basename(file).split('.').first
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
@@ -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'
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
@@ -0,0 +1,2 @@
1
+ ---
2
+ bar: 'baz'
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'rspec-puppet'
2
2
  require 'puppetlabs_spec_helper/module_spec_helper'
3
3
 
4
+ $LOAD_PATH.unshift '.'
5
+
4
6
  RSpec.configure do |c|
5
7
  c.color = true
6
8
  end
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
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: 2014-07-02 00:00:00 Z
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