Sha256: 577615c273471664c97f30afc8c63b84d6284debef90cb0d47e9b8cac42a62c9
Contents?: true
Size: 914 Bytes
Versions: 1
Compression:
Stored size: 914 Bytes
Contents
require ::File.expand_path('../spec_helper.rb', __FILE__) describe FnordMetric::TCPAcceptor do before(:all) do @redis = Redis.new @redis_wrap = RedisWrap.new(@redis) FnordMetric::TCPAcceptor.options( :redis_url => "redis://localhost:6379", :redis_prefix => "fnordmetric-test", :event_queue_ttl => 120 ) @inbound_stream = FnordMetric::TCPAcceptor.new(nil) end describe "pushing new events" do it "should add parsable event to the queue" do data = %Q{{"_type": "started"}\n} lambda { @inbound_stream.receive_data data }.should change { @redis.llen("fnordmetric-test-queue") }.by +1 end it "should reject non parsable events" do broken_data = %Q{{"_type": \n"started"}\n} lambda { @inbound_stream.receive_data broken_data }.should_not change { @redis.llen("fnordmetric-test-queue") } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fnordmetric-0.9.7 | spec/tcp_acceptor_spec.rb |