Geminstaller C0 Coverage Information - RCov

spec/unit/output_filter_spec.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/unit/output_filter_spec.rb 54 45
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 "An output filter" do
5   before(:each) do
6     @output_filter = GemInstaller::OutputFilter.new
7     @mock_output_proxy = mock("Mock OutputProxy")
8     @output_filter.output_proxy = @mock_output_proxy
9     @options = {}
10     @output_filter.options = @options
11     @message = "message"
12     @expected_rubygems_stdout_message = "[RubyGems:stdout] #{@message}"
13     @expected_rubygems_stderr_message = "[RubyGems:stderr] #{@message}"
14   end
15 
16   it "should pass formatted rubygems stdout message to output proxy if 'stdout' rubygems_output option is set" do
17     @options[:rubygems_output] = [:stdout]
18     @mock_output_proxy.should_receive(:sysout).with(@expected_rubygems_stdout_message)
19     @output_filter.rubygems_output(:stdout, @message)
20   end
21 
22   it "should pass formatted rubygems stdout and stderr message to output proxy if 'all' rubygems_output option is set" do
23     @options[:rubygems_output] = [:all]
24     @mock_output_proxy.should_receive(:sysout).with(@expected_rubygems_stdout_message)
25     @mock_output_proxy.should_receive(:sysout).with(@expected_rubygems_stderr_message)
26     @output_filter.rubygems_output(:stdout, @message)
27     @output_filter.rubygems_output(:stderr, @message)
28   end
29 
30   it "should not pass rubygems stdout message to output proxy if 'stdout' rubygems_output option is not set" do
31     @options[:rubygems_output] = [:stderr]
32     @output_filter.rubygems_output(:stdout, @message)
33   end
34 
35   it "should not pass any message to output proxy if 'silent' option is set" do
36     @options[:silent] = true
37     @output_filter.rubygems_output(:stdout, @message)
38     @output_filter.rubygems_output(:stderr, @message)
39   end
40 
41   it "should pass geminstaller info message to output proxy if 'info' geminstaller_output option is set" do
42     @options[:geminstaller_output] = [:info]
43     @mock_output_proxy.should_receive(:sysout).with(@message)
44     @output_filter.geminstaller_output(:info, @message)
45   end
46 
47   it "should use error stream if geminstaller output type is error" do
48     @options[:geminstaller_output] = [:error]
49     @mock_output_proxy.should_receive(:syserr).with(@message)
50     @output_filter.geminstaller_output(:error, @message)
51   end
52 
53 
54 end

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