Skip to content

Commit

Permalink
Added pending and focused tests to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
peterklijn committed Apr 2, 2017
1 parent 25c802b commit 73990e5
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion oleaster-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Oleaster Runner
=====
Oleaster Runner is a JUnit Runner that allows you to write JUnit tests like you would write Jasmine tests.

````java
```java
import org.junit.runner.RunWith;
import com.mscharhag.oleaster.runner.OleasterRunner;
import static com.mscharhag.oleaster.runner.StaticRunnerSupport.*;
Expand Down Expand Up @@ -173,6 +173,70 @@ describe("before/after example", () -> {
If `before()` or `after()` is used inside nested suites, `before()`/`after()` blocks of the outer suite
will run first.

## Focusing a test (run only a selection of tests)

With `fdescribe()` and `fit()` it is possible to run a single test or a single suite:

```java
describe("Test suite", () -> {
it("test", () -> {
// I will not run
assertTrue(false);
});

fit("focused test", () -> {
// I will run
assertTrue(true);
});

fdescribe("focused suite", () -> {
it("test", () -> {
// I will be run
assertTrue(true);
});
});

describe("normal suite", () -> {
it("test", () -> {
// I will not run
assertTrue(false);
});
});
});
```

## Skipping a test

With `xdescribe()` and `xit()` it is possible to disable a single test or single suite (mark as pending):

```java
describe("Test suite", () -> {
it("test", () -> {
// I will run
assertTrue(true);
});

it("pending test");

xit("another pending test", () -> {
// I will not run
assertTrue(false);
});

describe("normal suite", () -> {
it("test", () -> {
// I will run
assertTrue(true);
}); });

xdescribe("pending suite", () -> {
it("test", () -> {
// I will not run
assertTrue(false);
}); });
});
```

## Assertions

Validating the result of a test can be done in various ways.
Expand Down

0 comments on commit 73990e5

Please sign in to comment.