Skip to content

Commit 373d877

Browse files
committed
Add Test info to README
1 parent 1ef46b1 commit 373d877

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ A module looks something like this:
6666
│   └── WreckerClass.sh
6767
| └── ...
6868
└── lib
69-
└── wrecker_library_file.sh
70-
└── ...
69+
| └── wrecker_library_file.sh
70+
| └── ...
71+
└── test.sh
7172
```
7273

7374
> Feel free to add any folders or files you want to this -- this is simply the base structure that Ash uses. You can't break anything by adding new folders or files. You'll see I've even done this myself in [ash-make](https://github.com/ash-shell/ash-make).
@@ -83,6 +84,7 @@ name: Wrecker
8384
package: github.com/ash-shell/wrecker
8485
default_alias: wrecker
8586
callable_prefix: Wrecker
87+
test_prefix: Wrecker
8688
```
8789
8890
**`name`**: This is the human readable name of your module. This value is used by other modules who might want to output the name of the current module. This field is **required**.
@@ -93,6 +95,8 @@ callable_prefix: Wrecker
9395

9496
**`callable_prefix`**: This field specifies the function prefix that Ash looks for in the callable file when calling upon a module (more detail in [the section below](#callable-modules)). This field is only required for modules that provide a callable file.
9597

98+
**`test_prefix`**: This field specifies the function prefix that [Test](https://github.com/ash-shell/test) looks for in the `test.sh` file when running tests. This field is only required when you want to add tests to your module.
99+
96100
#### callable.sh
97101

98102
This file is only required if you want your library to be callable. The contents of this file are explained in [this section](#callable-modules).
@@ -119,6 +123,12 @@ You can nest folders inside of `lib` for structure, but you'll need to manage im
119123

120124
Files in the `lib` directory are auto loaded for you in the callable portions of your module, so you don't have to import your own module.
121125

126+
#### test.sh
127+
128+
This is the file in which you can write unit tests for your modules.
129+
130+
The README of [ash-shell/test](https://github.com/ash-shell/test) goes into full detail of how this all works.
131+
122132
## Callable Modules
123133

124134
You can build your module to be directly callable from the command line.

0 commit comments

Comments
 (0)