cooper-union-ece-160/1-bday/README.md

45 lines
1.7 KiB
Markdown

# bdaycardgen.sh
* Repo: <https://github.com/gary-kim/cooper-union-ece-160>
* Mirror: <https://git.garykim.dev/gary-kim/cooper-union-ece-160>
* Directory: `/1-bday/`
### Usage
```
$ ./bdaycardgen.sh --help
Usage: bdaycardgen.sh <BIRTHDAY_PERSON_NAME> <BIRTHDAY_PERSON_AGE> <CARD_SENDER_NAME>
bdaycardgen.sh is a script for generating birthday cards easily on the command line.
Examples:
bdaycardgen.sh "Birthday Child" 13 "Dad"
bdaycardgen.sh "Best Friend" 25 "Your Pal"
```
Running the script will output text for a birthday card to stdout.
### Included Files
* [bdaycardgen.sh](./bdaycardgen.sh): The birthday card generator itself
* [tests/test.sh](./tests/test.sh): Unit tests for the [bdaycardgen.sh](./bdaycardgen.sh) script
* [outputs/testoutput1.txt](./outputs/testoutput1.txt): Example output when [bdaycardgen.sh](./bdaycardgen.sh) is run with `$ bdaycardgen.sh "Generic Name" 13 "Generic Sender"`
### Testing
Inside the [tests/](tests/) directory, you will find unit tests for this script. It uses the testing framework [shunit2](https://github.com/kward/shunit2).
**If you are accessing this script through the Git repository, simply ensure that you have also cloned submodules by running `git submodule update --init --recursive` then simply run `tests/test.sh`.**
If you received this software on its own and not through the Git repo, you will need to follow the instructions below to setup [shunit2](https://github.com/kward/shunit2) first.
#### Testing without repo
Run the following commands to get [shunit2](https://github.com/kward/shunit2) then run the tests with that instance of [shunit2](https://github.com/kward/shunit2).
```bash
git clone https://github.com/kward/shunit2
SHUNIT2="shunit2/shunit2" tests/test.sh
```