Sha256: 3a8fb1ba358f9a4c1b7a4ed3280d8e8512c9468c5b0c57924904f189edc5580b

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

require ::File.expand_path('../spec_helper.rb', __FILE__)

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::TimeseriesGauge
  end

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

  it_should_behave_like FnordMetric::GaugeLike

  describe "option validation" do

    it "should raise when initialized with non-unique series tokens" do
      pending "fix me"
      lambda{
        FnordMetric::TimeseriesGauge.new(
          :series => [:fnord, :fnord], 
          :ticks => [1.hour],
          :key => 123, 
          :key_prefix => 123
        )
      }.should raise_exception
    end

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

    it "should raise when initialized with emtpy series tokens" do
      pending "fix me"
      lambda{
        FnordMetric::TimeseriesGauge.new(
          :series => [],
          :key => 123,
          :ticks => [1.hour],
          :key_prefix => 123
        )
      }.should raise_exception
    end

  end

end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
johnf-fnordmetric-1.2.10 spec/timeseries_gauge_spec.rb
fnordmetric-1.2.9 spec/timeseries_gauge_spec.rb
johnf-fnordmetric-1.2.7 spec/timeseries_gauge_spec.rb
bp-fnordmetric-1.2.7 spec/timeseries_gauge_spec.rb
fnordmetric-1.2.7 spec/timeseries_gauge_spec.rb
fnordmetric-1.2.6 spec/timeseries_gauge_spec.rb
fnordmetric-1.2.4 spec/timeseries_gauge_spec.rb
fnordmetric-1.2.1 spec/timeseries_gauge_spec.rb
fnordmetric-1.2.0 spec/timeseries_gauge_spec.rb
fnordmetric-1.0.1 spec/timeseries_gauge_spec.rb
fnordmetric-1.0.0 spec/timeseries_gauge_spec.rb