File tree Expand file tree Collapse file tree 3 files changed +81
-0
lines changed
Expand file tree Collapse file tree 3 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ # Minimal CI to see the output
2+ name : CI
3+ on :
4+ push :
5+ branches :
6+ - main
7+ tags-ignore :
8+ - " v*"
9+
10+ pull_request :
11+
12+ jobs :
13+ test :
14+ strategy :
15+ matrix :
16+ lua-version : ["5.3", "5.4"]
17+ runs-on : ubuntu-20.04
18+ steps :
19+ - uses : actions/checkout@v3
20+ - uses : leafo/gh-actions-lua@v10
21+ with :
22+ luaVersion : ${{ matrix.lua-version }}
23+ - uses : leafo/gh-actions-luarocks@v4
24+
25+ - name : build
26+ run : |
27+ luarocks install busted
28+ luarocks make
29+
30+ - name : test
31+ run : |
32+ busted -o codewars || true
Original file line number Diff line number Diff line change 11# busted-codewars
22
33Codewars output handler for [ Busted] ( https://github.com/lunarmodules/busted ) .
4+
5+ ## Install
6+
7+ ``` bash
8+ luarocks install busted-codewars
9+ ```
10+
11+ ## Usage
12+
13+ ``` bash
14+ busted -o codewars
15+ ```
16+
17+ ## Develop
18+
19+ Add example tests in ` spec/ ` with a file name matching ` *_spec.lua ` .
20+ Then run the tests with Codewars output:
21+
22+ ``` bash
23+ luarocks test -- -o codewars
24+ ```
Original file line number Diff line number Diff line change 1+ -- Example from https://lunarmodules.github.io/busted/
2+ describe (" Busted unit testing framework" , function ()
3+ describe (" should be awesome" , function ()
4+ it (" should be easy to use" , function ()
5+ assert .truthy (" Yup." )
6+ end )
7+
8+ it (" should have lots of features" , function ()
9+ -- deep check comparisons!
10+ assert .are .same ({ table = " great" }, { table = " great" })
11+
12+ -- or check by reference!
13+ assert .are_not .equal ({ table = " great" }, { table = " great" })
14+
15+ assert .truthy (" this is a string" ) -- truthy: not false or nil
16+
17+ assert .True (1 == 1 )
18+ assert .is_true (1 == 1 )
19+
20+ assert .falsy (nil )
21+ assert .has_error (function () error (" Wat" ) end , " Wat" )
22+ end )
23+
24+ it (" should provide some shortcuts to common functions" , function ()
25+ assert .are .unique ({{ thing = 1 }, { thing = 2 }, { thing = 3 }})
26+ end )
27+ end )
28+ end )
You can’t perform that action at this time.
0 commit comments