DEV: Allow rake plugin:spec to traverse symlinks
This commit is contained in:
parent
3119e88efe
commit
dfd63b185f
|
@ -87,7 +87,8 @@ desc 'run plugin specs'
|
||||||
task 'plugin:spec', :plugin do |t, args|
|
task 'plugin:spec', :plugin do |t, args|
|
||||||
args.with_defaults(plugin: "*")
|
args.with_defaults(plugin: "*")
|
||||||
ruby = `which ruby`.strip
|
ruby = `which ruby`.strip
|
||||||
files = Dir.glob("./plugins/#{args[:plugin]}/spec/**/*_spec.rb")
|
# Traverse symlinks (https://stackoverflow.com/questions/357754/can-i-traverse-symlinked-directories-in-ruby-with-a-glob)
|
||||||
|
files = Dir.glob("./plugins/#{args[:plugin]}/spec/**{,/*/**}/*_spec.rb")
|
||||||
if files.length > 0
|
if files.length > 0
|
||||||
sh "LOAD_PLUGINS=1 #{ruby} -S rspec #{files.join(' ')}"
|
sh "LOAD_PLUGINS=1 #{ruby} -S rspec #{files.join(' ')}"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue