1
require 'spec/runner/option_parser'
5
# Facade to run specs without having to fork a new ruby process (using `spec ...`)
8
# Runs specs. +argv+ is the commandline args as per the spec commandline API, +err+
9
# and +out+ are the streams output will be written to.
10
def run(instance_rspec_options)
11
# NOTE - this call to init_rspec_options is not spec'd, but neither is any of this
12
# swapping of $rspec_options. That is all here to enable rspec to run against itself
13
# and maintain coverage in a single process. Therefore, DO NOT mess with this stuff
14
# unless you know what you are doing!
15
init_rspec_options(instance_rspec_options)
16
orig_rspec_options = rspec_options
18
$rspec_options = instance_rspec_options
19
return $rspec_options.run_examples
22
$rspec_options = orig_rspec_options