puppetlabs_spec_helper 2.13.0 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +0 -1
- data/.rubocop.yml +29 -4
- data/.rubocop_todo.yml +26 -16
- data/.travis.yml +12 -14
- data/CHANGELOG.md +92 -1
- data/CODEOWNERS +2 -0
- data/Gemfile +34 -9
- data/README.md +38 -41
- data/Rakefile +1 -1
- data/lib/puppetlabs_spec_helper/module_spec_helper.rb +10 -0
- data/lib/puppetlabs_spec_helper/puppet_spec_helper.rb +4 -2
- data/lib/puppetlabs_spec_helper/puppetlabs_spec/files.rb +2 -0
- data/lib/puppetlabs_spec_helper/puppetlabs_spec/fixtures.rb +7 -2
- data/lib/puppetlabs_spec_helper/puppetlabs_spec/matchers.rb +4 -2
- data/lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb +3 -0
- data/lib/puppetlabs_spec_helper/puppetlabs_spec_helper.rb +2 -0
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +123 -18
- data/lib/puppetlabs_spec_helper/tasks/beaker.rb +12 -9
- data/lib/puppetlabs_spec_helper/tasks/check_symlinks.rb +4 -1
- data/lib/puppetlabs_spec_helper/tasks/fixtures.rb +161 -91
- data/lib/puppetlabs_spec_helper/version.rb +3 -1
- data/puppet_spec_helper.rb +2 -0
- data/puppetlabs_spec_helper.gemspec +7 -7
- data/puppetlabs_spec_helper.rb +2 -0
- metadata +69 -45
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rspec-puppet'
|
2
4
|
require 'puppetlabs_spec_helper/puppet_spec_helper'
|
3
5
|
require 'puppetlabs_spec_helper/puppetlabs_spec/puppet_internals'
|
@@ -50,6 +52,14 @@ if ENV['SIMPLECOV'] == 'yes'
|
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
55
|
+
# Add all spec lib dirs to LOAD_PATH
|
56
|
+
components = module_path.split(File::PATH_SEPARATOR).collect do |dir|
|
57
|
+
Dir.entries(dir).reject { |f| f =~ %r{^\.} }.collect { |f| File.join(dir, f, 'spec', 'lib') }
|
58
|
+
end
|
59
|
+
components.flatten.each do |d|
|
60
|
+
$LOAD_PATH << d if FileTest.directory?(d) && !$LOAD_PATH.include?(d)
|
61
|
+
end
|
62
|
+
|
53
63
|
RSpec.configure do |c|
|
54
64
|
c.environmentpath = spec_path if Puppet.version.to_f >= 4.0
|
55
65
|
c.module_path = module_path
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'puppetlabs_spec_helper/puppetlabs_spec_helper'
|
2
4
|
|
3
5
|
# Don't want puppet getting the command line arguments for rake or autotest
|
@@ -45,7 +47,7 @@ require 'puppetlabs_spec_helper/puppetlabs_spec/files'
|
|
45
47
|
# to compatibility mode for older versions of puppet.
|
46
48
|
begin
|
47
49
|
require 'puppet/test/test_helper'
|
48
|
-
rescue LoadError =>
|
50
|
+
rescue LoadError => e
|
49
51
|
end
|
50
52
|
|
51
53
|
# This is just a utility class to allow us to isolate the various version-specific
|
@@ -58,7 +60,7 @@ module Puppet
|
|
58
60
|
# Puppet's Settings singleton object, and other fun implementation details
|
59
61
|
# that code external to puppet should really never know about.
|
60
62
|
def self.initialize_via_fallback_compatibility(config)
|
61
|
-
|
63
|
+
warn('Warning: you appear to be using an older version of puppet; spec_helper will use fallback compatibility mode.')
|
62
64
|
config.before :all do
|
63
65
|
# nothing to do for now
|
64
66
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This module provides some helper methods to assist with fixtures. It's
|
2
4
|
# methods are designed to help when you have a conforming fixture layout so we
|
3
5
|
# get project consistency.
|
@@ -14,6 +16,7 @@ module PuppetlabsSpec::Fixtures
|
|
14
16
|
callers = caller
|
15
17
|
while line = callers.shift
|
16
18
|
next unless found = line.match(%r{/spec/(.*)_spec\.rb:})
|
19
|
+
|
17
20
|
return fixtures(found[1])
|
18
21
|
end
|
19
22
|
raise "sorry, I couldn't work out your path from the caller stack!"
|
@@ -26,6 +29,7 @@ module PuppetlabsSpec::Fixtures
|
|
26
29
|
unless File.readable? file
|
27
30
|
raise "fixture '#{name}' for #{my_fixture_dir} is not readable"
|
28
31
|
end
|
32
|
+
|
29
33
|
file
|
30
34
|
end
|
31
35
|
|
@@ -37,12 +41,13 @@ module PuppetlabsSpec::Fixtures
|
|
37
41
|
|
38
42
|
# Provides a block mechanism for iterating across the files in your fixture
|
39
43
|
# area.
|
40
|
-
def my_fixtures(glob = '*', flags = 0)
|
44
|
+
def my_fixtures(glob = '*', flags = 0, &block)
|
41
45
|
files = Dir.glob(File.join(my_fixture_dir, glob), flags)
|
42
46
|
if files.empty?
|
43
47
|
raise "fixture '#{glob}' for #{my_fixture_dir} had no files!"
|
44
48
|
end
|
45
|
-
|
49
|
+
|
50
|
+
block_given? && files.each(&block)
|
46
51
|
files
|
47
52
|
end
|
48
53
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'stringio'
|
2
4
|
require 'rspec/expectations'
|
3
5
|
|
@@ -6,8 +8,8 @@ require 'rspec/expectations'
|
|
6
8
|
module RSpec
|
7
9
|
module Matchers
|
8
10
|
module BlockAliases
|
9
|
-
if method_defined? :
|
10
|
-
alias to should
|
11
|
+
if method_defined?(:should) && !method_defined?(:to)
|
12
|
+
alias to should
|
11
13
|
end
|
12
14
|
if method_defined? :should_not
|
13
15
|
alias to_not should_not unless method_defined? :to_not
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Initialize puppet for testing by loading the
|
2
4
|
# 'puppetlabs_spec_helper/puppet_spec_helper' library
|
3
5
|
require 'puppetlabs_spec_helper/puppet_spec_helper'
|
@@ -67,6 +69,7 @@ module PuppetlabsSpec
|
|
67
69
|
# exists. This is a hack, but at least it's a hidden hack and not an
|
68
70
|
# exposed hack.
|
69
71
|
return nil unless Puppet::Parser::Functions.function(name)
|
72
|
+
|
70
73
|
scope.method("function_#{name}".intern)
|
71
74
|
end
|
72
75
|
module_function :function_method
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'fileutils'
|
2
4
|
require 'rake'
|
3
5
|
require 'rspec/core/rake_task'
|
@@ -16,6 +18,24 @@ rescue LoadError
|
|
16
18
|
# ignore
|
17
19
|
end
|
18
20
|
|
21
|
+
begin
|
22
|
+
require 'puppet_blacksmith/rake_tasks'
|
23
|
+
rescue LoadError
|
24
|
+
# ignore
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require 'github_changelog_generator/task'
|
29
|
+
rescue LoadError
|
30
|
+
# ignore
|
31
|
+
end
|
32
|
+
|
33
|
+
begin
|
34
|
+
require 'puppet-strings/tasks'
|
35
|
+
rescue LoadError
|
36
|
+
# ignore
|
37
|
+
end
|
38
|
+
|
19
39
|
parallel_tests_loaded = false
|
20
40
|
begin
|
21
41
|
require 'parallel_tests'
|
@@ -29,12 +49,13 @@ task default: [:help]
|
|
29
49
|
pattern = 'spec/{aliases,classes,defines,functions,hosts,integration,plans,tasks,type_aliases,types,unit}/**/*_spec.rb'
|
30
50
|
|
31
51
|
RSpec::Core::RakeTask.new(:spec_standalone) do |t, args|
|
32
|
-
t.rspec_opts = [
|
52
|
+
t.rspec_opts = []
|
33
53
|
t.rspec_opts << ENV['CI_SPEC_OPTIONS'] unless ENV['CI_SPEC_OPTIONS'].nil?
|
34
54
|
if ENV['CI_NODE_TOTAL'] && ENV['CI_NODE_INDEX']
|
35
55
|
ci_total = ENV['CI_NODE_TOTAL'].to_i
|
36
56
|
ci_index = ENV['CI_NODE_INDEX'].to_i
|
37
57
|
raise "CI_NODE_INDEX must be between 1-#{ci_total}" unless ci_index >= 1 && ci_index <= ci_total
|
58
|
+
|
38
59
|
files = Rake::FileList[pattern].to_a
|
39
60
|
per_node = (files.size / ci_total.to_f).ceil
|
40
61
|
t.pattern = if args.extras.nil? || args.extras.empty?
|
@@ -90,16 +111,17 @@ end
|
|
90
111
|
desc 'Parallel spec tests'
|
91
112
|
task :parallel_spec_standalone do |_t, args|
|
92
113
|
raise 'Add the parallel_tests gem to Gemfile to enable this task' unless parallel_tests_loaded
|
114
|
+
|
93
115
|
if Rake::FileList[pattern].to_a.empty?
|
94
116
|
warn 'No files for parallel_spec to run against'
|
95
117
|
else
|
96
|
-
begin
|
97
|
-
args = ['-t', 'rspec']
|
98
|
-
args += ENV['CI_SPEC_OPTIONS'].strip.split(' ') unless ENV['CI_SPEC_OPTIONS'].nil? || ENV['CI_SPEC_OPTIONS'].strip.empty?
|
99
|
-
args += Rake::FileList[pattern].to_a
|
100
118
|
|
101
|
-
|
102
|
-
|
119
|
+
args = ['-t', 'rspec']
|
120
|
+
args.push('--').concat(ENV['CI_SPEC_OPTIONS'].strip.split(' ')).push('--') unless ENV['CI_SPEC_OPTIONS'].nil? || ENV['CI_SPEC_OPTIONS'].strip.empty?
|
121
|
+
args.concat(Rake::FileList[pattern].to_a)
|
122
|
+
|
123
|
+
ParallelTests::CLI.new.run(args)
|
124
|
+
|
103
125
|
end
|
104
126
|
end
|
105
127
|
|
@@ -124,6 +146,7 @@ namespace :build do
|
|
124
146
|
desc 'Build Puppet module with PDK'
|
125
147
|
task :pdk do
|
126
148
|
begin
|
149
|
+
require 'pdk/util'
|
127
150
|
require 'pdk/module/build'
|
128
151
|
|
129
152
|
path = PDK::Module::Build.invoke(:force => true, :'target-dir' => File.join(Dir.pwd, 'pkg'))
|
@@ -131,7 +154,7 @@ namespace :build do
|
|
131
154
|
rescue LoadError
|
132
155
|
_ = `pdk --version`
|
133
156
|
unless $CHILD_STATUS.success?
|
134
|
-
|
157
|
+
warn 'Unable to build module. Please install PDK or add the `pdk` gem to your Gemfile.'
|
135
158
|
abort
|
136
159
|
end
|
137
160
|
|
@@ -202,7 +225,8 @@ PuppetSyntax.exclude_paths ||= []
|
|
202
225
|
PuppetSyntax.exclude_paths << 'spec/fixtures/**/*'
|
203
226
|
PuppetSyntax.exclude_paths << 'pkg/**/*'
|
204
227
|
PuppetSyntax.exclude_paths << 'vendor/**/*'
|
205
|
-
PuppetSyntax.exclude_paths << '
|
228
|
+
PuppetSyntax.exclude_paths << '.vendor/**/*'
|
229
|
+
PuppetSyntax.exclude_paths << 'plans/**/*'
|
206
230
|
if Puppet.version.to_f < 4.0
|
207
231
|
PuppetSyntax.exclude_paths << 'types/**/*'
|
208
232
|
end
|
@@ -243,7 +267,7 @@ task :compute_dev_version do
|
|
243
267
|
version = modinfo['version']
|
244
268
|
elsif File.exist?('Modulefile')
|
245
269
|
modfile = File.read('Modulefile')
|
246
|
-
version = modfile.match(%r{\nversion
|
270
|
+
version = modfile.match(%r{\nversion +['"](.*)['"]})[1]
|
247
271
|
else
|
248
272
|
raise 'Could not find a metadata.json or Modulefile! Cannot compute dev version without one or the other!'
|
249
273
|
end
|
@@ -257,10 +281,10 @@ task :compute_dev_version do
|
|
257
281
|
# More info can be found at https://tickets.puppetlabs.com/browse/FM-6170
|
258
282
|
new_version = if build = ENV['BUILD_NUMBER'] || ENV['TRAVIS_BUILD_NUMBER']
|
259
283
|
if branch.eql? 'release'
|
260
|
-
'%s-%s%04d-%s' % [version, 'r', build, sha]
|
284
|
+
'%s-%s%04d-%s' % [version, 'r', build, sha] # legacy support code # rubocop:disable Style/FormatStringToken
|
261
285
|
else
|
262
|
-
'%s-%04d-%s' % [version, build, sha]
|
263
|
-
|
286
|
+
'%s-%04d-%s' % [version, build, sha] # legacy support code # rubocop:disable Style/FormatStringToken
|
287
|
+
end
|
264
288
|
else
|
265
289
|
"#{version}-#{sha}"
|
266
290
|
end
|
@@ -277,10 +301,7 @@ task :release_checks do
|
|
277
301
|
else
|
278
302
|
Rake::Task[:spec].invoke
|
279
303
|
end
|
280
|
-
Rake::Task[
|
281
|
-
Rake::Task['check:test_file'].invoke
|
282
|
-
Rake::Task['check:dot_underscore'].invoke
|
283
|
-
Rake::Task['check:git_ignore'].invoke
|
304
|
+
Rake::Task[:check].invoke
|
284
305
|
end
|
285
306
|
|
286
307
|
namespace :check do
|
@@ -321,6 +342,9 @@ namespace :check do
|
|
321
342
|
end
|
322
343
|
end
|
323
344
|
|
345
|
+
desc 'Run static pre release checks'
|
346
|
+
task check: ['check:symlinks', 'check:test_file', 'check:dot_underscore', 'check:git_ignore']
|
347
|
+
|
324
348
|
desc 'Display the list of available rake tasks'
|
325
349
|
task :help do
|
326
350
|
system('rake -T')
|
@@ -349,7 +373,7 @@ if File.exist? locales_dir
|
|
349
373
|
spec = Gem::Specification.find_by_name 'gettext-setup'
|
350
374
|
load "#{spec.gem_dir}/lib/tasks/gettext.rake"
|
351
375
|
# Initialization requires a valid locales directory
|
352
|
-
GettextSetup.
|
376
|
+
GettextSetup.initialize(locales_dir)
|
353
377
|
namespace :module do
|
354
378
|
desc 'Runs all tasks to build a modules POT file for internationalization'
|
355
379
|
task :pot_gen do
|
@@ -361,3 +385,84 @@ if File.exist? locales_dir
|
|
361
385
|
puts 'No gettext-setup gem found, skipping GettextSetup config initialization' if Rake.verbose == true
|
362
386
|
end
|
363
387
|
end
|
388
|
+
|
389
|
+
def create_gch_task(changelog_user = nil, changelog_project = nil, changelog_since_tag = nil, changelog_tag_pattern = 'v%s')
|
390
|
+
if Bundler.rubygems.find_name('github_changelog_generator').any?
|
391
|
+
# needed a place to hide these methods
|
392
|
+
# rubocop:disable Lint/NestedMethodDefinition
|
393
|
+
def changelog_user_from_metadata
|
394
|
+
result = JSON.parse(File.read('metadata.json'))['author']
|
395
|
+
raise 'unable to find the changelog_user in .sync.yml, or the author in metadata.json' if result.nil?
|
396
|
+
|
397
|
+
puts "GitHubChangelogGenerator user:#{result}"
|
398
|
+
result
|
399
|
+
end
|
400
|
+
|
401
|
+
def changelog_project_from_metadata
|
402
|
+
result = JSON.parse(File.read('metadata.json'))['name']
|
403
|
+
raise 'unable to find the changelog_project in .sync.yml or the name in metadata.json' if result.nil?
|
404
|
+
|
405
|
+
puts "GitHubChangelogGenerator project:#{result}"
|
406
|
+
result
|
407
|
+
end
|
408
|
+
|
409
|
+
def changelog_future_release
|
410
|
+
return unless Rake.application.top_level_tasks.include? 'changelog'
|
411
|
+
|
412
|
+
result = JSON.parse(File.read('metadata.json'))['version']
|
413
|
+
raise 'unable to find the future_release (version) in metadata.json' if result.nil?
|
414
|
+
|
415
|
+
puts "GitHubChangelogGenerator future_release:#{result}"
|
416
|
+
result
|
417
|
+
end
|
418
|
+
# rubocop:enable Lint/NestedMethodDefinition
|
419
|
+
|
420
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
421
|
+
if ENV['CHANGELOG_GITHUB_TOKEN'].nil?
|
422
|
+
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'"
|
423
|
+
end
|
424
|
+
|
425
|
+
config.user = changelog_user || changelog_user_from_metadata
|
426
|
+
config.project = changelog_project || changelog_project_from_metadata
|
427
|
+
config.since_tag = changelog_since_tag if changelog_since_tag
|
428
|
+
config.future_release = changelog_tag_pattern % changelog_future_release.to_s
|
429
|
+
config.exclude_labels = ['maintenance']
|
430
|
+
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. " \
|
431
|
+
'The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres ' \
|
432
|
+
'to [Semantic Versioning](https://semver.org).'
|
433
|
+
config.add_pr_wo_labels = true
|
434
|
+
config.issues = false
|
435
|
+
config.merge_prefix = '### UNCATEGORIZED PRS; GO LABEL THEM'
|
436
|
+
config.configure_sections = {
|
437
|
+
'Changed' => {
|
438
|
+
'prefix' => '### Changed',
|
439
|
+
'labels' => ['backwards-incompatible'],
|
440
|
+
},
|
441
|
+
'Added' => {
|
442
|
+
'prefix' => '### Added',
|
443
|
+
'labels' => %w[feature enhancement],
|
444
|
+
},
|
445
|
+
'Fixed' => {
|
446
|
+
'prefix' => '### Fixed',
|
447
|
+
'labels' => ['bugfix'],
|
448
|
+
},
|
449
|
+
}
|
450
|
+
end
|
451
|
+
else
|
452
|
+
desc 'Generate a Changelog from GitHub'
|
453
|
+
task :changelog do
|
454
|
+
raise <<MESSAGE
|
455
|
+
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
|
456
|
+
Please manually add it to your .sync.yml for now, and run `pdk update`:
|
457
|
+
---
|
458
|
+
Gemfile:
|
459
|
+
optional:
|
460
|
+
':development':
|
461
|
+
- gem: 'github_changelog_generator'
|
462
|
+
git: 'https://github.com/skywinder/github-changelog-generator'
|
463
|
+
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
|
464
|
+
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
|
465
|
+
MESSAGE
|
466
|
+
end
|
467
|
+
end
|
468
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rspec/core/rake_task'
|
2
4
|
|
3
5
|
module PuppetlabsSpecHelper; end
|
@@ -10,9 +12,7 @@ module PuppetlabsSpecHelper::Tasks::BeakerHelpers
|
|
10
12
|
|
11
13
|
# cache the repositories and return a hash object
|
12
14
|
def repositories
|
13
|
-
|
14
|
-
@repositories = fixtures('repositories')
|
15
|
-
end
|
15
|
+
@repositories ||= fixtures('repositories')
|
16
16
|
@repositories
|
17
17
|
end
|
18
18
|
|
@@ -20,6 +20,7 @@ module PuppetlabsSpecHelper::Tasks::BeakerHelpers
|
|
20
20
|
# @return [Array<String>]
|
21
21
|
def beaker_node_sets
|
22
22
|
return @beaker_nodes if @beaker_nodes
|
23
|
+
|
23
24
|
@beaker_nodes = Dir['spec/acceptance/nodesets/*.yml'].sort.map do |node_set|
|
24
25
|
node_set.slice!('.yml')
|
25
26
|
File.basename(node_set)
|
@@ -50,7 +51,7 @@ module PuppetlabsSpecHelper::Tasks::BeakerHelpers
|
|
50
51
|
end
|
51
52
|
end
|
52
53
|
end
|
53
|
-
include PuppetlabsSpecHelper::Tasks::BeakerHelpers
|
54
|
+
include PuppetlabsSpecHelper::Tasks::BeakerHelpers # legacy support code # rubocop:disable Style/MixinUsage
|
54
55
|
|
55
56
|
desc 'Run beaker acceptance tests'
|
56
57
|
RSpec::Core::RakeTask.new(:beaker) do |t|
|
@@ -58,24 +59,26 @@ RSpec::Core::RakeTask.new(:beaker) do |t|
|
|
58
59
|
end
|
59
60
|
|
60
61
|
class SetupBeaker
|
61
|
-
def self.setup_beaker(
|
62
|
-
|
63
|
-
|
62
|
+
def self.setup_beaker(task)
|
63
|
+
task.rspec_opts = []
|
64
|
+
task.pattern = 'spec/acceptance'
|
64
65
|
# TEST_TIERS env variable is a comma separated list of tiers to run. e.g. low, medium, high
|
65
66
|
if ENV['TEST_TIERS']
|
66
67
|
test_tiers = ENV['TEST_TIERS'].split(',')
|
67
68
|
test_tiers_allowed = ENV.fetch('TEST_TIERS_ALLOWED', 'low,medium,high').split(',')
|
68
69
|
raise 'TEST_TIERS env variable must have at least 1 tier specified. Either low, medium or high or one of the tiers listed in TEST_TIERS_ALLOWED (comma separated).' if test_tiers.count == 0
|
70
|
+
|
69
71
|
test_tiers.each do |tier|
|
70
72
|
tier_to_add = tier.strip.downcase
|
71
73
|
raise "#{tier_to_add} not a valid test tier." unless test_tiers_allowed.include?(tier_to_add)
|
74
|
+
|
72
75
|
tiers = "--tag tier_#{tier_to_add}"
|
73
|
-
|
76
|
+
task.rspec_opts.push(tiers)
|
74
77
|
end
|
75
78
|
else
|
76
79
|
puts 'TEST_TIERS env variable not defined. Defaulting to run all tests.'
|
77
80
|
end
|
78
|
-
|
81
|
+
task
|
79
82
|
end
|
80
83
|
end
|
81
84
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'pathspec'
|
2
4
|
|
3
5
|
module PuppetlabsSpecHelper; end
|
@@ -33,7 +35,7 @@ class PuppetlabsSpecHelper::Tasks::CheckSymlinks
|
|
33
35
|
end
|
34
36
|
|
35
37
|
def ignored?(path)
|
36
|
-
path = path
|
38
|
+
path = "#{path}/" if File.directory?(path)
|
37
39
|
|
38
40
|
!ignore_pathspec.match_paths([path], Dir.pwd).empty?
|
39
41
|
end
|
@@ -42,6 +44,7 @@ class PuppetlabsSpecHelper::Tasks::CheckSymlinks
|
|
42
44
|
@ignore_pathspec ||= PathSpec.new(DEFAULT_IGNORED).tap do |pathspec|
|
43
45
|
IGNORE_LIST_FILES.each do |f|
|
44
46
|
next unless File.file?(f) && File.readable?(f)
|
47
|
+
|
45
48
|
File.open(f, 'r') { |fd| pathspec.add(fd) }
|
46
49
|
end
|
47
50
|
end
|