aboutsummaryrefslogtreecommitdiffstats
path: root/spec
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
commit838f8ebd5bb26c2c96644af9e4f80ea7e150d976 (patch)
tree27fe95e5b4e75623d91a0afe754eb75efa3d1d24 /spec
parent19b7e38e1c80c4f9a8623877d36bbe4c5251c696 (diff)
downloadprosody-838f8ebd5bb26c2c96644af9e4f80ea7e150d976.tar.gz
prosody-838f8ebd5bb26c2c96644af9e4f80ea7e150d976.zip
util.ringbuffer: Add some initial tests
Diffstat (limited to 'spec')
-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);