Geminstaller C0 Coverage Information - RCov

spec/functional/output_proxy_spec.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/functional/output_proxy_spec.rb 50 44
100.00%
100.00%

Key

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.

Coverage Details

1 dir = File.dirname(__FILE__)
2 require File.expand_path("#{dir}/../helper/spec_helper")
3 
4 describe "The output proxy" do
5   before(:each) do
6     @output_proxy = GemInstaller::OutputProxy.new
7     @original_stdout = $stdout
8     @mock_stdout = MockStdout.new
9     $stdout = @mock_stdout
10     @original_stderr = $stderr
11     @mock_stderr = MockStderr.new
12     $stderr = @mock_stderr
13     @options = {}
14     @output_proxy.options = @options
15   end
16 
17   it "should proxy to stdout and stderr" do
18     sysout = "out!"
19     syserr = "err!"
20     @output_proxy.sysout(sysout)
21     @output_proxy.syserr(syserr)
22     @mock_stdout.out.should==(sysout)
23     @mock_stderr.err.should==(syserr)
24   end
25   
26   it "should support option to redirect stderr to stdout" do
27     syserr = "err!"
28     @options[:redirect_stderr_to_stdout] = true
29     @output_proxy.syserr(syserr)
30     @mock_stdout.out.should==(syserr)
31     @mock_stderr.err.should==(nil)
32   end
33   
34   it "should allow default output stream to be set for output method" do
35     sysout = "out!"
36     syserr = "err!"
37     @output_proxy.default_stream = :stdout
38     @output_proxy.output(sysout)
39     @mock_stdout.out.should==(sysout)
40     @output_proxy.default_stream = :stderr
41     @output_proxy.output(syserr)
42     @mock_stderr.err.should==(syserr)    
43   end
44   
45   after(:each) do
46     $stdout = @original_stdout
47     $stderr = @original_stderr
48   end
49 
50 end

Generated on Mon May 10 23:40:29 -0700 2010 with rcov 0.9.8