KO! (aka Knockout) is a next-generation unit testing framework for the Ruby programming language. What makes KO! so modern?
- Clear and concise syntax.
- No assertions framework required!
- Rapidly test multiple parameter sets on a test scenario.
- Reusable contexts (before, after, etc).
- Easily stage test fixture files.
- And yes, it eats it's own dog food.
KO reads like a developer thinks. More specifically, KO! breaks down the systems analysis proccess into clear and obvious divisions. KO "specifications" are divided-up into test cases, contexts, concerns and test assertions.
- Test Cases delineate the overall requirement that is to be demonstrated.
- Contexts are used to setup and teardown test fixtures.
- Concerns break-up testcases into separate areas of concern.
- Test Assertions compose the proof of a testcase as a set of assertions.
Here is simple example.
KO.case "example" do test "equality" do |a,b| a == b end ok 1, 1.0 no 1, 2.0 end
KO! was inspired in part by the void left behind by the discontinuation of Shoulda as a test framework. It seemed like an opportune time to give Ruby an elegant, modern and light-weight test framework to serve as an alternative to the monolithic RSpec.
Future versions of KO! may also support Lemon's unit test coverage system.