Coiby Xu
|
93373c0406
|
unit tests: add tests for get_grub_kernel_boot_parameter
This test suite makes use of three features provided by ShellSpec
- funcion-based mock [2]: mock a function by re-defining and exporting it
- parameterized tests [3]: run multiple sets of input against the same
test
- %text directive [4]: similar to heredoc but free of
the indentation issue
Note
1. Describe and Context are aliases for ExampleGroup which a block for
grouping example groups or examples [5]. Describe and Context are used to
improve readability.
2. ShellSpec requires .shellspec file.
[1] https://github.com/dodie/testing-in-bash#detailed-comparision
[2] https://github.com/shellspec/shellspec#function-based-mock
[3] https://github.com/shellspec/shellspec#parameters---parameterized-example
[4] https://github.com/shellspec/shellspec#text---embedded-text
[5] https://github.com/shellspec/shellspec#dsl-syntax
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Coiby Xu <coxu@redhat.com>
|
2022-04-14 11:44:27 +08:00 |
|