Sha256: bfb1f07a8fc80e052074a3b801497d878ca551cdb1eb00ba2a6978461db6f123

Contents?: true

Size: 1.32 KB

Versions: 26

Compression:

Stored size: 1.32 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

describe RcovGrapher do 
  before :each do
    @rcov_grapher = MetricFu::RcovGrapher.new
    MetricFu.configuration
  end
  
  it "should respond to rcov_percent and labels" do
    @rcov_grapher.should respond_to(:rcov_percent)
    @rcov_grapher.should respond_to(:labels)
  end
  
  describe "responding to #initialize" do
    it "should initialise rcov_percent and labels" do
      @rcov_grapher.rcov_percent.should == []
      @rcov_grapher.labels.should == {}
    end
  end
  
  describe "responding to #get_metrics" do
    before(:each) do
      @metrics = YAML::load(File.open(File.join(File.dirname(__FILE__), "..", "resources", "yml", "20090630.yml")))
      @date = "01022003"
    end
    
    it "should push 49.6 to rcov_percent" do
      @rcov_grapher.rcov_percent.should_receive(:push).with(49.6)      
      @rcov_grapher.get_metrics(@metrics, @date)
    end
    
    it "should update labels with the date" do
      @rcov_grapher.labels.should_receive(:update).with({ 0 => "01022003" })
      @rcov_grapher.get_metrics(@metrics, @date)
    end
  end
  
  describe "responding to #graph!" do
    it "should write rcov.png" do
      @rcov_grapher.graph!
      lambda{ File.open(File.join(MetricFu.output_directory, 'rcov.png')) }.should_not raise_error
    end
  end
end

Version data entries

26 entries across 26 versions & 11 rubygems

Version Path
IPGlider-metric_fu-1.1.5.1.1 spec/graphs/rcov_grapher_spec.rb
IPGlider-metric_fu-1.1.5.1 spec/graphs/rcov_grapher_spec.rb
gforces-metric_fu-1.1.4 spec/graphs/rcov_grapher_spec.rb
iain-metric_fu-0.1.0 spec/graphs/rcov_grapher_spec.rb
iain-metric_fu-0.1.1 spec/graphs/rcov_grapher_spec.rb
iain-metric_fu-0.1.2 spec/graphs/rcov_grapher_spec.rb
jscruggs-metric_fu-1.1.2 spec/graphs/rcov_grapher_spec.rb
jscruggs-metric_fu-1.1.3 spec/graphs/rcov_grapher_spec.rb
jscruggs-metric_fu-1.1.4 spec/graphs/rcov_grapher_spec.rb
jscruggs-metric_fu-1.1.5 spec/graphs/rcov_grapher_spec.rb
kjeldahl-metric_fu-1.1.5.1 spec/graphs/rcov_grapher_spec.rb
kjeldahl-metric_fu-1.1.5.2 spec/graphs/rcov_grapher_spec.rb
kjeldahl-metric_fu-1.1.5.3 spec/graphs/rcov_grapher_spec.rb
kjeldahl-metric_fu-1.1.5.4 spec/graphs/rcov_grapher_spec.rb
kjeldahl-metric_fu-1.1.5 spec/graphs/rcov_grapher_spec.rb
mattvanhorn-metric_fu-1.1.5.1 spec/graphs/rcov_grapher_spec.rb
mattvanhorn-metric_fu-1.1.5.2 spec/graphs/rcov_grapher_spec.rb
mtdewboy-metric_fu-1.1.5.1 spec/graphs/rcov_grapher_spec.rb
mwilden-metric_fu-1.1.3 spec/graphs/rcov_grapher_spec.rb
mwilden-metric_fu-1.1.5 spec/graphs/rcov_grapher_spec.rb