Sha256: c0c4675700cd40ce8c82d71e019cd6baf61e447db29d13dee73fd25021baa629
Contents?: true
Size: 738 Bytes
Versions: 13
Compression:
Stored size: 738 Bytes
Contents
require 'rspec' require 'stringio' require "yajl" require_relative "gorgon_rspec_formatter" class RspecRunner class << self def run_file(filename) args = [ '-f', 'RSpec::Core::Formatters::GorgonRspecFormatter', filename ] err, out = StringIO.new, StringIO.new keep_config_modules do RSpec::Core::Runner.run(args, err, out) end out.rewind Yajl::Parser.new(:symbolize_keys => true).parse(out.read) end def runner :rspec end private def keep_config_modules orig_configuration = ::RSpec.configuration.clone yield ::RSpec.instance_variable_set(:@configuration, orig_configuration) end end end
Version data entries
13 entries across 13 versions & 1 rubygems