Sha256: b2a8ae073bf72ddf6856c35a9a9aa3acfc2519d4c1059e7c335de04b5a560e64

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

require "stringio"
require 'rubygems'
require 'spec'
require 'spec/runner/formatter/specdoc_formatter'

module Spec
  module Runner
    module Formatter
      class BaseTextFormatter
        def dump_failure(counter, failure)
          @output.puts
          @output.puts "#{counter.to_s})"
          @output.puts colorize_failure("#{failure.header}\n#{failure.exception.message}", failure)
          @output.puts format_backtrace(failure.exception.backtrace)
          @output.flush
        end
      end
    end
  end
end

def run_spec(spec, base_dir, run_opts = "-fs")

  $VERBOSE = nil
  err, out = StringIO.new, StringIO.new
  def out.tty?() true end
  options = Spec::Runner::OptionParser.parse(%W(#{spec} --color).concat(%W(#{run_opts})), err, out)
  options.filename_pattern = File.expand_path(spec)
  failure = ! Spec::Runner::CommandLine.run(options)
  File.open(base_dir / "results" / "#{File.basename(spec)}_out", "w") do |file|
    file.puts out.string
  end
  File.open(base_dir / "results" / "#{File.basename(spec)}_err", "w") do |file|
    file.puts err.string
  end
  exit!(failure ? -1 : 0)
end

run_spec(ARGV[0], File.expand_path(File.join(File.dirname(__FILE__), "..", "..", ".."))) if ENV["NOW"]

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-core-1.1.3 lib/merb-core/test/run_spec.rb
merb-core-1.1.2 lib/merb-core/test/run_spec.rb
merb-core-1.1.1 lib/merb-core/test/run_spec.rb
merb-core-1.1.0 lib/merb-core/test/run_spec.rb
merb-core-1.1.0.rc1 lib/merb-core/test/run_spec.rb
merb-core-1.1.0.pre lib/merb-core/test/run_spec.rb