lib/sauron/sauron_template.rb in sauron-0.1.24 vs lib/sauron/sauron_template.rb in sauron-0.1.26

- old
+ new

@@ -38,9 +38,20 @@ system "time ruby -I.:lib:test -rubygems -e \"require '#{file}'\"" when 'rspec' system "time ruby script/spec -O spec/spec.opts #{file}" end end + + def run_pattern_tests prefix, pattern, suffix + files = [] + + elements = pattern.split(/_/) + while elements.shift + files << Dir.glob("#{prefix}#{elements.join('_')}#{suffix}") unless elements.empty? + end + + run_multiple_tests files + end def run_multiple_tests *files joined_files = files.join(',') message "running #{files.first.size} tests: #{joined_files}"