Skip to content

Commit

Permalink
- fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Mar 19, 2013
1 parent 61aac12 commit 3294f0e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions spec/inputs/redis.rb
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
require "test_utils"
require "redis"

describe "inputs/redis" do
extend LogStash::RSpec

populate = proc do |key, event_count|
require "logstash/event"
redis = Redis.new(:host => "localhost")
event_count.times do |value|
event = LogStash::Event.new("@fields" => { "sequence" => value })
Stud::try(10.times) do
redis.rpush(key, event.to_json)
end
def populate(key, event_count)
require "logstash/event"
redis = Redis.new(:host => "localhost")
event_count.times do |value|
event = LogStash::Event.new("@fields" => { "sequence" => value })
Stud::try(10.times) do
redis.rpush(key, event.to_json)
end
end
end

process = proc do |plugins, event_count|
sequence = 0
redis = plugins.first
output = Shiftback.new do |event|
insist { event["sequence"] } == sequence
sequence += 1
redis.teardown if sequence == event_count
end
redis.register
redis.run(output)
end # process
def process(plugins, event_count)
sequence = 0
redis = plugins.first
output = Shiftback.new do |event|
insist { event["sequence"] } == sequence
sequence += 1
redis.teardown if sequence == event_count
end
redis.register
redis.run(output)
end # process

describe "inputs/redis" do
extend LogStash::RSpec

describe "read events from a list" do
key = 10.times.collect { rand(10).to_s }.join("")
Expand Down

0 comments on commit 3294f0e

Please sign in to comment.