spec/util_ringbuffer_spec.lua
author Kim Alvefur <zash@zash.se>
Fri, 29 May 2020 17:53:00 +0200
changeset 10901 37df1e757f02
child 10902 c6465fb3c839
permissions -rw-r--r--
util.ringbuffer: Add some initial tests

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);