File: tests_runner.rb

package info (click to toggle)
ruby-rr 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,424 kB
  • sloc: ruby: 11,405; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Project
  class TestsRunner
    def self.call(project)
      runner = new(project)
      yield runner if block_given?
      runner.call
    end

    attr_reader :project
    attr_accessor :command

    def initialize(project)
      @project = project
      self.command = project.test_runner_command
    end

    def call
      match = command.match(/^((?:\w+=[^ ]+ )*)(.+)$/)
      project.run_command_within(match[2], :env => match[1])
    end
  end
end