Sha256: 464b5e2a8bb469496277e4156fb1b47c48a3679975c6522e9b5e2c965aa049ee

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

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

describe RoodiGrapher do 
  before :each do
    @roodi_grapher = MetricFu::RoodiGrapher.new
    MetricFu.configuration
  end
  
  it "should respond to roodi_count and labels" do
    @roodi_grapher.should respond_to(:roodi_count)
    @roodi_grapher.should respond_to(:labels)
  end
  
  describe "responding to #initialize" do
    it "should initialise roodi_count and labels" do
      @roodi_grapher.roodi_count.should == []
      @roodi_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 = "1/2"
    end
    
    it "should push 13 to roodi_count" do
      @roodi_grapher.roodi_count.should_receive(:push).with(13)      
      @roodi_grapher.get_metrics(@metrics, @date)
    end
    
    it "should update labels with the date" do
      @roodi_grapher.labels.should_receive(:update).with({ 0 => "1/2" })
      @roodi_grapher.get_metrics(@metrics, @date)
    end
  end
end

Version data entries

11 entries across 11 versions & 7 rubygems

Version Path
cayblood-metric_fu-1.1.6 spec/graphs/roodi_grapher_spec.rb
metric_fu-1.5.0 spec/graphs/roodi_grapher_spec.rb
metric_fu-1.4.0 spec/graphs/roodi_grapher_spec.rb
cdd-metric_fu-1.3.1 spec/graphs/roodi_grapher_spec.rb
devver-metric_fu-1.3.3 spec/graphs/roodi_grapher_spec.rb
nielsm-metric_fu-1.3.1 spec/graphs/roodi_grapher_spec.rb
metric_fu-1.3.0 spec/graphs/roodi_grapher_spec.rb
edouard-metric_fu-1.2.1 spec/graphs/roodi_grapher_spec.rb
edouard-metric_fu-1.2.0 spec/graphs/roodi_grapher_spec.rb
metric_fu-1.2.0 spec/graphs/roodi_grapher_spec.rb
flyerhzm-metric_fu-1.0.0 spec/graphs/roodi_grapher_spec.rb