lib/retest/repository.rb in retest-0.9.0 vs lib/retest/repository.rb in retest-1.0.0.pre

- old
+ new

@@ -11,13 +11,23 @@ def find_test(path) return unless path return if path.empty? - cache[path] ||= select_from TestOptions.for(path, files: files) + @path = path + cache[@path] ||= select_from TestOptions.for(@path, files: files) end + def find_tests(paths) + paths + .select { |path| Regexp.new("\.rb$") =~ path } + .map { |path| find_test(path) } + .compact + .uniq + .sort + end + def add(added) return if added&.empty? files.push(*added) files.sort! @@ -45,10 +55,10 @@ end end def ask_question(tests) output_stream.puts <<~QUESTION - We found few tests matching: + We found few tests matching: #{@path} #{list_options(tests)} Which file do you want to use? Enter the file number now: QUESTION \ No newline at end of file