aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_ringbuffer_spec.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-29 17:53:00 +0200
committerKim Alvefur <zash@zash.se>2020-05-29 17:53:00 +0200
commit4c70417684d3617a83aacc8cae16078e354ad87b (patch)
tree27fe95e5b4e75623d91a0afe754eb75efa3d1d24 /spec/util_ringbuffer_spec.lua
parent506a747629dcbeb61be9735a86994d70c1379e40 (diff)
downloadprosody-4c70417684d3617a83aacc8cae16078e354ad87b.tar.gz
prosody-4c70417684d3617a83aacc8cae16078e354ad87b.zip
util.ringbuffer: Add some initial tests
Diffstat (limited to 'spec/util_ringbuffer_spec.lua')
-rw-r--r--spec/util_ringbuffer_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/util_ringbuffer_spec.lua b/spec/util_ringbuffer_spec.lua
new file mode 100644
index 00000000..5d63b24b
--- /dev/null
+++ b/spec/util_ringbuffer_spec.lua
@@ -0,0 +1,17 @@
+local rb = require "util.ringbuffer";
+describe("util.ringbuffer", function ()
+ describe("#new", function ()
+ it("has a constructor", function ()
+ assert.Function(rb.new);
+ end);
+ it("can be created", function ()
+ assert.truthy(rb.new());
+ end);
+ end);
+ describe(":write", function ()
+ local b = rb.new();
+ it("works", function ()
+ assert.truthy(b:write("hi"));
+ end);
+ end);
+end);