Skip to content

Commit

Permalink
Merge pull request #66 from ekohl/fix-plugin-spec-testing
Browse files Browse the repository at this point in the history
Fix plugin regressions introduced in 3.0.0
  • Loading branch information
chelnak authored Oct 20, 2022
2 parents 47ffa8a + a97f52d commit 51511a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions lib/puppet-lint/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ class PuppetLint::Plugins
#
# Returns nothing.
def self.load_from_gems
plugins_directories = gem_directories.select do |directory|
(directory + 'puppet-lint/plugins').to_s if (directory + 'puppet-lint/plugins').directory?
end

plugin_files = plugins_directories.each do |directory|
Dir["#{directory}/**/*.rb"]
end
gem_directories.each do |directory|
path = directory + 'puppet-lint/plugins'
next unless path.directory?

plugin_files.each do |file|
load(file)
Dir["#{path}/**/*.rb"].each do |file|
load(file)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def subject
config.include(
RSpec::LintExampleGroup,
type: :lint,
file_path: Regexp.compile(['spec', 'unit', 'puppet-lint', 'plugins'].join('[\\\/]')),
file_path: Regexp.new('spec[\\\/](unit[\\\/])?puppet-lint[\\\/]plugins'),
)

config.expect_with(:rspec) do |c|
Expand Down

0 comments on commit 51511a5

Please sign in to comment.