Sha256: 3a093d3c218e55838ad1458c18a9ba1b3fe133957c9b26915def7dd38cd4f85a
Contents?: true
Size: 764 Bytes
Versions: 1
Compression:
Stored size: 764 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 ensure RSpec.reset ::RSpec.instance_variable_set(:@configuration, orig_configuration) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gorgon-0.10.1 | lib/gorgon/rspec_runner.rb |