Sha256: f0f6e19c55f899b7cd869861a6b56c2357203e344ef53dc520c59e0627ae6faa

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

module Koine
  class TestRunner
    class CommandExecuter
      def execute(command)
        start = Time.now
        system(command.to_s)
        finish = Time.now
        elapsed = finish - start
        logger.info("#{command} => elapsed time: #{elapsed.round(2)}")
        $?.exitstatus
      end

      def fail(reason)
        puts reason
        exit(1)
      end

      def execute_and_exit(command)
        puts command
        exit(execute(command))
      end

      def logger
        @logger ||= Logger.new('/tmp/test_runner.log')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
koine-test_runner-0.3.0 lib/koine/test_runner/command_executer.rb