Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb | 61 | 48 | 83.61%
|
79.17%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 require 'drb/drb' |
2 |
3 module RSpec |
4 module Core |
5 class Runner |
6 |
7 def self.autorun |
8 return if autorun_disabled? || installed_at_exit? || running_in_drb? |
9 @installed_at_exit = true |
10 at_exit { run(ARGV, $stderr, $stdout) ? exit(0) : exit(1) } |
11 end |
12 |
13 def self.autorun_disabled? |
14 @autorun_disabled ||= false |
15 end |
16 |
17 def self.disable_autorun! |
18 @autorun_disabled = true |
19 end |
20 |
21 def self.installed_at_exit? |
22 @installed_at_exit ||= false |
23 end |
24 |
25 def self.running_in_drb? |
26 (DRb.current_server rescue false) && |
27 DRb.current_server.uri =~ /druby\:\/\/127.0.0.1\:/ |
28 end |
29 |
30 def self.trap_interrupt |
31 trap('INT') do |
32 exit!(1) if RSpec.wants_to_quit |
33 RSpec.wants_to_quit = true |
34 STDERR.puts "\nExiting... Interrupt again to exit immediately." |
35 end |
36 end |
37 |
38 def self.run(args, err, out) |
39 trap_interrupt |
40 options = ConfigurationOptions.new(args) |
41 options.parse_options |
42 |
43 if options.options[:drb] |
44 run_over_drb(options, err, out) || run_in_process(options, err, out) |
45 else |
46 run_in_process(options, err, out) |
47 end |
48 end |
49 |
50 def self.run_over_drb(options, err, out) |
51 DRbCommandLine.new(options).run(err, out) |
52 end |
53 |
54 def self.run_in_process(options, err, out) |
55 CommandLine.new(options, RSpec::configuration, RSpec::world).run(err, out) |
56 end |
57 |
58 end |
59 |
60 end |
61 end |
Generated on Fri Apr 22 17:22:42 -0700 2011 with rcov 0.9.8