Sha256: 0149651e7095758ca644a9a0c963fc3363ad181cd3ece7a06661e0de71f61211

Contents?: true

Size: 762 Bytes

Versions: 10

Compression:

Stored size: 762 Bytes

Contents

require 'parallel_split_test/command_line'
require 'shellwords'

# a cleaned up version of the RSpec runner, e.g. no drb support
module ParallelSplitTest
  class Runner < RSpec::Core::Runner
    # @overwrite
    # stripped down version of run without --drb support / option parsing
    def self.run(args, err=$stderr, out=$stdout)
      trap_interrupt

      report_execution_time(out) do
        ParallelSplitTest::CommandLine.new(args).run(err, out)
      end
    ensure
      RSpec.reset
    end

    private

    def self.report_execution_time(out)
      start = Time.now.to_f
      result = yield
      runtime = Time.now.to_f - start
      out.puts "Took %.2f seconds with #{ParallelSplitTest.processes} processes" % runtime
      result
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
parallel_split_test-0.10.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.9.1 lib/parallel_split_test/runner.rb
parallel_split_test-0.9.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.8.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.7.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.6.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.5.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.4.1 lib/parallel_split_test/runner.rb
parallel_split_test-0.4.0 lib/parallel_split_test/runner.rb
parallel_split_test-0.3.0 lib/parallel_split_test/runner.rb