Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 424 Bytes
title
Parameterised Tests

Parameterised tests are easy in Cuppa. In fact, if you've ever used a for loop before, then you already know how!

for (int x : inputs) {
    it("returns -1 for " + x, () -> {
        // ...
    });
}

You can even turn tests on and off based on conditions.

if (inProductionEnvironment()) {
    it("works in production", () -> {
        // ...
    });
}

Magic!