Skip to content

Commit

Permalink
Finish off docs for 0.1.
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
mblayman committed Jul 10, 2023
1 parent 290a10b commit f718eab
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Contributing

Thanks for your interest in luatest.
Here are some ground rules for contributing
to this project.

1. Be kind. This is a volunteer project. Please set your expectations appropriately.
2. Got a feature? Come talk! File an issue in GitHub and we can discuss.
This project will attempt to stay very tight on features,
so please come discuss before (potentially) wasting your time on a PR
that won't be accepted.
3. PRs *must* come with test code to verify changes.
4. Code coverage must be 100%. *No exceptions.*
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,30 @@ tests_dir = "tests"
# This default pattern will match a file that looks like "test_<something>.lua".
test_file_pattern = "test_.+%.lua"
```

## Test files

By default, luatest will search for files in a top-level `tests` directory.
A test file should be standard Lua module.
luatest will execute every function that is added
to the test file's module table.

This is an example file to show what your test module may look like.
Assume that this file is `tests/test_example.lua`

```lua
local assert = require "luassert"

local my_module = require "my_module"

local tests = {}

-- my_func answers the meaning of life.
function tests.test_my_func()
local meaning_of_life = my_module.my_func()

assert.is_equal(42, meaning_of_life)
end

return tests
```

0 comments on commit f718eab

Please sign in to comment.