spec/lib/tabs_spec.rb in tabs-0.5.0 vs spec/lib/tabs_spec.rb in tabs-0.5.2

- old
+ new

@@ -1,8 +1,9 @@ require "spec_helper" describe Tabs do + include Tabs::Storage describe "#create_metric" do it "raises an error if the type is invalid" do lambda { Tabs.create_metric("foo", "foobar") }.should raise_error(Tabs::UnknownTypeError) @@ -72,10 +73,16 @@ Tabs.drop_metric("foo") expect(Tabs.list_metrics).to_not include("foo") expect(Tabs.metric_exists?("foo")).to be_false end - it "removes the metrics values from redis" + it "removes the metrics values from redis" do + Tabs.increment_counter("foo") + keys = smembers("tabs:stat:keys:foo:hour") + expect(redis.keys).to include("tabs:stat:keys:foo:hour") + Tabs.drop_metric("foo") + expect(redis.keys).to_not include(keys[0]) + end end describe "#increment_counter" do