Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 96d3b2e61a
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (28 sloc) 0.936 kb
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
pending "fixme"
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
Jump to Line
Something went wrong with that request. Please try again.