From dfd63b185f3b5279f49f979638dd17c30431669e Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 1 Feb 2019 10:40:41 +0000 Subject: [PATCH] DEV: Allow rake plugin:spec to traverse symlinks --- lib/tasks/plugin.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rake index c77525038f5..13f18c120e8 100644 --- a/lib/tasks/plugin.rake +++ b/lib/tasks/plugin.rake @@ -87,7 +87,8 @@ desc 'run plugin specs' task 'plugin:spec', :plugin do |t, args| args.with_defaults(plugin: "*") 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 sh "LOAD_PLUGINS=1 #{ruby} -S rspec #{files.join(' ')}" else