Skip to content

Commit 8aa7f0d

Browse files
committed
Small improve to the specs
* `batch_events` is now randomized * added a canary to ensure the batch specs run with batch enabled. Fixes #24
1 parent 3152545 commit 8aa7f0d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

spec/outputs/redis_spec.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,21 @@
5555
end
5656

5757
context "when batch_mode is true" do
58-
include_examples "writing to redis list", {
58+
batch_events = Flores::Random.integer(1..1000)
59+
batch_settings = {
5960
"batch" => true,
60-
"batch_timeout" => 5,
61-
"timeout" => 5
61+
"batch_events" => batch_events
6262
}
63+
64+
include_examples "writing to redis list", batch_settings do
65+
66+
# A canary to make sure we're actually enabling batch mode
67+
# in this shared example.
68+
it "should have batch mode enabled" do
69+
expect(redis_config).to include("batch")
70+
expect(redis_config["batch"]).to be_truthy
71+
end
72+
end
6373
end
6474
end
6575

0 commit comments

Comments
 (0)