X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=spec%2Funit%2Frunnerstats_spec.rb;fp=spec%2Funit%2Frunnerstats_spec.rb;h=0000000000000000000000000000000000000000;hb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;hp=1002d12439bbbe3304083a8e06c7a00e621b2e66;hpb=8a3fe7daeecccf43dd71c59371c5005400d35101;p=packages%2Fprecise%2Fmcollective.git diff --git a/spec/unit/runnerstats_spec.rb b/spec/unit/runnerstats_spec.rb deleted file mode 100755 index 1002d12..0000000 --- a/spec/unit/runnerstats_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env rspec - -require 'spec_helper' - -module MCollective - describe RunnerStats do - before do - Agents.stubs(:agentlist).returns("agents") - Time.stubs(:now).returns(Time.at(0)) - - @stats = RunnerStats.new - - logger = mock - logger.stubs(:log) - logger.stubs(:start) - Log.configure(logger) - end - - describe "#to_hash" do - it "should return the correct data" do - @stats.to_hash.keys.sort.should == [:stats, :threads, :pid, :times, :agents].sort - - @stats.to_hash[:stats].should == {:validated => 0, :unvalidated => 0, :passed => 0, :filtered => 0, - :starttime => 0, :total => 0, :ttlexpired => 0, :replies => 0} - - @stats.to_hash[:agents].should == "agents" - end - end - - [[:ttlexpired, :ttlexpired], [:passed, :passed], [:filtered, :filtered], - [:validated, :validated], [:received, :total], [:sent, :replies]].each do |tst| - describe "##{tst.first}" do - it "should increment #{tst.first}" do - @stats.send(tst.first) - @stats.to_hash[:stats][tst.last].should == 1 - end - end - end - end -end