Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (28 sloc) 0.936 kB
83d3a0f merged Only parsable events are added to event queue by inbound strea…
Paul Asmuth authored
1 require ::File.expand_path('../spec_helper.rb', __FILE__)
2
b84b2a8 @paulasmuth spec cleanup
authored
3 describe FnordMetric::TCPAcceptor do
83d3a0f merged Only parsable events are added to event queue by inbound strea…
Paul Asmuth authored
4
5 before(:all) do
6 @redis = Redis.new
7 @redis_wrap = RedisWrap.new(@redis)
b84b2a8 @paulasmuth spec cleanup
authored
8 FnordMetric::TCPAcceptor.options(
83d3a0f merged Only parsable events are added to event queue by inbound strea…
Paul Asmuth authored
9 :redis_url => "redis://localhost:6379",
10 :redis_prefix => "fnordmetric-test",
11 :event_queue_ttl => 120
12 )
b84b2a8 @paulasmuth spec cleanup
authored
13 @inbound_stream = FnordMetric::TCPAcceptor.new(nil)
83d3a0f merged Only parsable events are added to event queue by inbound strea…
Paul Asmuth authored
14 end
15
16 describe "pushing new events" do
17 it "should add parsable event to the queue" do
bdce780 @paulasmuth spec fixes + marked some specs as pending
authored
18 pending "fixme"
83d3a0f merged Only parsable events are added to event queue by inbound strea…
Paul Asmuth authored
19 data = %Q{{"_type": "started"}\n}
20
21 lambda {
22 @inbound_stream.receive_data data
23 }.should change { @redis.llen("fnordmetric-test-queue") }.by +1
24 end
25
26 it "should reject non parsable events" do
27 broken_data = %Q{{"_type": \n"started"}\n}
4c0e13f @rossta Provide UDP connection alternative to tcp for inbound stream
rossta authored
28
83d3a0f merged Only parsable events are added to event queue by inbound strea…
Paul Asmuth authored
29 lambda {
30 @inbound_stream.receive_data broken_data
31 }.should_not change { @redis.llen("fnordmetric-test-queue") }
32 end
33 end
34 end
35
Something went wrong with that request. Please try again.