Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b0o/mulberry
Mulberry is a single-file Lua BDD library for testing Neovim plugins.
https://github.com/b0o/mulberry
bdd bdd-framework bdd-tests lua lua-bdd lua-testing neovim neovim-lua testing testing-library unit-testing
Last synced: 7 days ago
JSON representation
Mulberry is a single-file Lua BDD library for testing Neovim plugins.
- Host: GitHub
- URL: https://github.com/b0o/mulberry
- Owner: b0o
- License: mit
- Created: 2021-10-11T09:58:41.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T05:52:22.000Z (6 months ago)
- Last Synced: 2024-05-17T06:46:37.263Z (6 months ago)
- Topics: bdd, bdd-framework, bdd-tests, lua, lua-bdd, lua-testing, neovim, neovim-lua, testing, testing-library, unit-testing
- Language: Lua
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mulberry [![license: MIT](https://img.shields.io/github/license/b0o/mulberry?style=flat&color=green)](https://mit-license.org) [![Test Status](https://img.shields.io/github/actions/workflow/status/b0o/mulberry/test.yaml?branch=main&label=tests)](https://github.com/b0o/mulberry/actions/workflows/test.yaml)
Mulberry is a single-file Lua BDD library for testing Neovim plugins. Its goal is to make testing your plugins as easy and delicious as possible.
An example Mulberry test suite:
```lua
Describe("the awesome foobar plugin", function()
It("can do the foo.do", function()
local foo = require'foo'
local myFoo = { lol: 'wut', yes: 'no' }
local bar = foo.do(myFoo)
Expect(bar).To.Be.A.ListLike()
end)It("can foo.bar all the things", function()
local foo = require'foo'
local bar = foo.bar({ allTheThings: true })Expect(bar).To.HaveFieldPaths({
{ 'theThings.allOfThem[1].description', Which.Is.A.String },
{ 'theThings.allOfThem[1].items', Which.Is.A.ListLike },
{ 'theThings.allOfThem[1].name', Which.Is.A.String },
{ 'theThings.allOfThem[1].url', Which.Is.A.String },
{ 'theThings.allOfThem[1].enabled', Which.Is.True },
})
end)It("doesn't go meta on you", function()
local foo = require'foo'
Expect(foo).To.Not.HaveMetatable()
end)It("always calls you back", function()
local foo = require'foo'
Expect(foo.someFooFunction).To.EvaluateTo(0xF00)
end)
end)
```## Changelog
```
v0.0.3 2023-07-31
fix: ensure ListLike and DictLike values are tables
fix: implement list_contains for nvim < v0.10
v0.0.2 2023-07-31
fix: matchers.In should check for existence of keys, not values
```## License
© 2021-2023 Maddison Hellstrom
Released under the MIT License.