File tree 2 files changed +13
-13
lines changed
2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 80
80
],
81
81
"description" : " MySQL module" ,
82
82
"template-url" : " https://github.com/puppetlabs/pdk-templates" ,
83
- "template-ref" : " heads/master-0-g8fc95db " ,
83
+ "template-ref" : " heads/master-0-gabccfb1 " ,
84
84
"pdk-version" : " 1.7.0"
85
85
}
Original file line number Diff line number Diff line change 1
1
require 'puppetlabs_spec_helper/module_spec_helper'
2
2
require 'rspec-puppet-facts'
3
3
4
- begin
5
- require 'spec_helper_local' if File . file? ( File . join ( File . dirname ( __FILE__ ) , 'spec_helper_local.rb' ) )
6
- rescue LoadError => loaderror
7
- warn "Could not require spec_helper_local: #{ loaderror . message } "
8
- end
4
+ require 'spec_helper_local' if File . file? ( File . join ( File . dirname ( __FILE__ ) , 'spec_helper_local.rb' ) )
9
5
10
6
include RspecPuppetFacts
11
7
14
10
facterversion : Facter . version ,
15
11
}
16
12
17
- default_facts_path = File . expand_path ( File . join ( File . dirname ( __FILE__ ) , 'default_facts.yml' ) )
18
- default_module_facts_path = File . expand_path ( File . join ( File . dirname ( __FILE__ ) , 'default_module_facts.yml' ) )
13
+ default_fact_files = [
14
+ File . expand_path ( File . join ( File . dirname ( __FILE__ ) , 'default_facts.yml' ) ) ,
15
+ File . expand_path ( File . join ( File . dirname ( __FILE__ ) , 'default_module_facts.yml' ) ) ,
16
+ ]
19
17
20
- if File . exist? ( default_facts_path ) && File . readable? ( default_facts_path )
21
- default_facts . merge! ( YAML . safe_load ( File . read ( default_facts_path ) ) )
22
- end
18
+ default_fact_files . each do |f |
19
+ next unless File . exist? ( f ) && File . readable? ( f ) && File . size? ( f )
23
20
24
- if File . exist? ( default_module_facts_path ) && File . readable? ( default_module_facts_path )
25
- default_facts . merge! ( YAML . safe_load ( File . read ( default_module_facts_path ) ) )
21
+ begin
22
+ default_facts . merge! ( YAML . safe_load ( File . read ( f ) ) )
23
+ rescue => e
24
+ RSpec . configuration . reporter . message "WARNING: Unable to load #{ f } : #{ e } "
25
+ end
26
26
end
27
27
28
28
RSpec . configure do |c |
You can’t perform that action at this time.
0 commit comments