lib/testrbl.rb in testrbl-0.1.11 vs lib/testrbl.rb in testrbl-0.1.12

- old
+ new

@@ -28,21 +28,11 @@ # no bundle exec: projects with mini and unit-test do not run well via bundle exec testrb run "testrb #{argv.map{|a| a.include?(' ') ? "'#{a}'" : a }.join(' ')}" end end - private - - def self.bundle_exec - "bundle exec " if File.file?("Gemfile") - end - - def self.run(command) - puts command - exec command - end - + # useable e.g. via zeus def self.pattern_from_file(lines, line) search = lines[0..(line.to_i-1)].reverse last_spaces = " " * 100 found = search.map{|line| pattern_from_line(line) }.compact @@ -60,9 +50,20 @@ end return use.reverse.join(".*") if found.size > 0 raise "no test found before line #{line}" + end + + private + + def self.bundle_exec + "bundle exec " if File.file?("Gemfile") + end + + def self.run(command) + puts command + exec command end def self.pattern_from_line(line) PATTERNS.each do |r| if line =~ r