From 24be4aeef966c2907b45f9c2cfad98196569c116 Mon Sep 17 00:00:00 2001 From: Joey Date: Tue, 7 Jul 2015 13:46:08 -0600 Subject: [PATCH] Added installation instructions. --- README.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5b57e4b..2ee2ad4 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,37 @@ # einheit -Nim unit testing library inspired by Python's unit tests. Nim's unittest library is good, but I wanted something a little more "Nim" feeling. I also really like Python's unittest module and thought it would be nice to have something similar in Nim. Also, unittest doesn't have much documentation on how to use it, and it's pretty bare bones, so I wanted a little more functionality and documentation. + +Einheit means unit in German. + +Einheit is a Nim unit testing library inspired by Python's unit tests. Nim's unittest library is good, but I wanted something a little more "Nim" feeling. I also really like Python's unittest module and thought it would be nice to have something similar in Nim. Also, unittest doesn't have much documentation on how to use it, and it's pretty bare bones, so I wanted a little more functionality and documentation. The benefit of the macro style I chose means that you can document your tests nicely as well :) ### Description -Compile-time macro that allows a user to easily define tests and run them. +test_suite is a compile-time macro that allows a user to easily define tests and run them. -Methods are used for inheritance, so if you want to derive a test -suite, then you have to make sure the base suite uses methods -for the tests that you want to derive. +Methods are used for inheritance, so if you want to derive a test suite, then you have to make sure the base suite uses methods for the tests that you want to derive. If you don't want inheritance, you can just use procs. -A special proc/method is called setup(). The macro will inject -this if it doesn't exist and it will be called before running -the test suite. +A special proc/method is called setup(). The macro will inject this method/proc if it doesn't exist and it will be called before running the test suite. -Test methods/procs to be run are prefixed with "test" in the -method/proc name. This is so that you can write tests that call -procs that do other things and won't be run as a test. +Test methods/procs to be run are prefixed with "test" in the method/proc name. This is so that you can write tests that call procs that do other things and won't be run as a test. -For each suite method/proc, an implicit variable called "self" -is added. This lets you access the test_suite in an OO kind -of way. +For each suite method/proc, an implicit variable called "self" is added. This lets you access the test_suite in an OO kind of way. +### Installation + +Install with nimble! + +```bash +nimble install einheit +``` ### Usage ```nim +import einheit + test_suite SuiteName of TestSuite: var