Rakefile in duck_puncher-4.2.3 vs Rakefile in duck_puncher-4.3.0

- old
+ new

@@ -1,13 +1,13 @@ require 'bundler/gem_tasks' require 'rake' require 'rake/testtask' -# Rake::TestTask.new(:soft_punch_test) do |t| -# t.pattern = 'test/soft_punch/*_test.rb' -# end - -Rake::TestTask.new(:hard_punch_test) do |t| - t.pattern = 'test/lib/**/*_test.rb' +root = Pathname.new File.expand_path('..', __FILE__) +tasks = [] +Dir[root.join('test/lib/**/*_test.rb')].each do |file| + tasks << Rake::TestTask.new(file.split('/').last[/\w+/].to_sym) do |t| + t.pattern = file.sub(root.to_s + '/', '') + end end -task default: [:hard_punch_test] +task default: tasks.map(&:name)