changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/lib/spec/runner/command_line.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require 'spec/runner/option_parser'
2
3module Spec
4 module Runner
5 # Facade to run specs without having to fork a new ruby process (using `spec ...`)
6 class CommandLine
7 class << self
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
17 begin
18 $rspec_options = instance_rspec_options
19 return $rspec_options.run_examples
20 ensure
21 ::Spec.run = true
22 $rspec_options = orig_rspec_options
23 end
24 end
25 end
26 end
27 end
28end