Commit b84b2a8d authored by Paul Asmuth's avatar Paul Asmuth
Browse files

spec cleanup

parent b26d4c35
Loading
Loading
Loading
Loading

spec/mutli_gauge_spec.rb

deleted100644 → 0
+0 −18
Original line number Diff line number Diff line
require ::File.expand_path('../spec_helper.rb', __FILE__)

describe FnordMetric::MultiGauge do

  before(:all) do    
    @now = Time.utc(1992,01,13,5,23,23).to_i    
    @redis = Redis.new
    @redis_wrap = RedisWrap.new(@redis, false)
    @gauge_klass = FnordMetric::MultiGauge
  end

  before(:each) do
    @redis.keys("fnordmetric-myns*").each { |k| @redis.del(k) }  
  end

  it_should_behave_like FnordMetric::GaugeLike

end
+3 −3
Original line number Diff line number Diff line
require ::File.expand_path('../spec_helper.rb', __FILE__)

describe FnordMetric::InboundStream do
describe FnordMetric::TCPAcceptor do

  before(:all) do
    @redis = Redis.new
    @redis_wrap = RedisWrap.new(@redis)
    FnordMetric::InboundStream.options(
    FnordMetric::TCPAcceptor.options(
      :redis_url => "redis://localhost:6379",
      :redis_prefix => "fnordmetric-test",
      :event_queue_ttl => 120
    )
    @inbound_stream = FnordMetric::InboundStream.new(nil)
    @inbound_stream = FnordMetric::TCPAcceptor.new(nil)
  end

  describe "pushing new events" do
+5 −37
Original line number Diff line number Diff line
require ::File.expand_path('../spec_helper.rb', __FILE__)

describe FnordMetric::NumericGauge do
describe FnordMetric::TimeseriesGauge do

  before(:all) do    
    @now = Time.utc(1992,01,13,5,23,23).to_i    
    @redis = Redis.new
    @redis_wrap = RedisWrap.new(@redis, false)
    @gauge_klass = FnordMetric::NumericGauge
    @gauge_klass = FnordMetric::TimeseriesGauge
  end

  before(:each) do
@@ -19,7 +19,7 @@ describe FnordMetric::NumericGauge do

    it "should raise when initialized with non-unique series tokens" do
      lambda{
        FnordMetric::NumericGauge.new(
        FnordMetric::TimeseriesGauge.new(
          :series => [:fnord, :fnord], 
          :ticks => [1.hour],
          :key => 123, 
@@ -30,7 +30,7 @@ describe FnordMetric::NumericGauge do

    it "should raise when initialized without series tokens key" do
      lambda{
        FnordMetric::NumericGauge.new(
        FnordMetric::TimeseriesGauge.new(
          :key => 123, 
          :ticks => [1.hour],
          :key_prefix => 123
@@ -40,7 +40,7 @@ describe FnordMetric::NumericGauge do

    it "should raise when initialized with emtpy series tokens" do
      lambda{
        FnordMetric::NumericGauge.new(
        FnordMetric::TimeseriesGauge.new(
          :series => [],
          :key => 123,
          :ticks => [1.hour],
@@ -49,38 +49,6 @@ describe FnordMetric::NumericGauge do
      }.should raise_exception
    end

    it "should raise when initialized without ticks key" do
      lambda{
        FnordMetric::NumericGauge.new(
          :key => 123, 
          :series => [:fu],
          :key_prefix => 123
        )
      }.should raise_exception
    end

    it "should raise when initialized with emtpy ticks" do
      lambda{
        FnordMetric::NumericGauge.new(
          :ticks => [],
          :series => [:fu],
          :key => 123, 
          :key_prefix => 123
        )
      }.should raise_exception
    end

    it "should raise when initialized with invalid ticks" do
      lambda{
        FnordMetric::NumericGauge.new(
          :ticks => ["fnord"],
          :series => ["fu"],
          :key => 123, 
          :key_prefix => 123
        )
      }.should raise_exception
    end

  end

end
+3 −3
Original line number Diff line number Diff line
require ::File.expand_path('../spec_helper.rb', __FILE__)

describe FnordMetric::InboundDatagram do
describe FnordMetric::UDPAcceptor do

  let(:inbound_datagram) { FnordMetric::InboundDatagram.new(nil) }
  let(:inbound_datagram) { FnordMetric::UDPAcceptor.new(nil) }

  before(:all) do
    @redis = Redis.new
    @redis_wrap = RedisWrap.new(@redis)
    FnordMetric::InboundDatagram.opts = {
    FnordMetric::UDPAcceptor.opts = {
      :redis_url => "redis://localhost:6379",
      :redis_prefix => "fnordmetric-test",
      :event_queue_ttl => 120