31 lines
872 B
Plaintext
31 lines
872 B
Plaintext
local assert = require("luassert")
|
|
|
|
describe("Busted unit testing framework", function()
|
|
describe("should be awesome", function()
|
|
it("should be easy to use", function()
|
|
assert.truthy "Yup."
|
|
end)
|
|
|
|
it("should have lots of features", function()
|
|
-- deep check comparisons!
|
|
assert.same({ table = "great" }, { table = "great" })
|
|
|
|
-- or check by reference!
|
|
assert.not_equal({ table = "great" }, { table = "great" })
|
|
|
|
assert.truthy "this is a string" -- truthy: not false or nil
|
|
|
|
assert.is_true(1 == 1)
|
|
|
|
assert.falsy(nil)
|
|
assert.has_error(function()
|
|
error "Wat"
|
|
end, "Wat")
|
|
end)
|
|
|
|
it("should provide some shortcuts to common functions", function()
|
|
assert.is_unique { { thing = 1 }, { thing = 2 }, { thing = 3 } }
|
|
end)
|
|
end)
|
|
end)
|