clog-tool / clog-cli

Generate beautiful changelogs from your Git commit history
MIT License
851 stars 43 forks source link

tests: write tests for all library components #60

Open 0x-r4bbit opened 9 years ago

0x-r4bbit commented 9 years ago

Couldn't find any tests in the source yet (if there are any, please point me to them). Is there already a convenient way of writing (unit) tests for Rust libraries?

kbknapp commented 9 years ago

We don't have any yet. But there are several convenient ways to write tests in Rust. We can use cargo integration tests by adding a tests/ directory, unit level testing via a mod tests { } or function level testing with #[test] directive (or a combination of all three). Some good reading on the subject is can be found the relevant section of the book.

It's all relatively easy...just time consuming.

Also as of clap v1.0.0 arguments can be parsed from arbitrary locations (i.e. simulated command line usage), meaning we could even add CLI testing.