Skip to content

Commit

Permalink
#29 replace timeout/timeoutUnit with Duration in README
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Helmbold committed Jun 29, 2016
1 parent bccb7a1 commit 601b0cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Each test can be configured with various parameters. After the test block, invok
* `invocations` - the number of times to run this test. Useful if you have a non-deterministic test and you want to run that particular test a set number of times. Defaults to 1.
* `threads` - Allows the invocation of this test to be parallelized by setting the number of threads to use in a thread pool executor for this test. If invocations is 1 (the default) then this parameter will have no effect. Similarly, if you set invocations to a value less than or equal to the number threads, then each invocation will have its own thread.
* `ignored` - If set to true then this test is ignored. Can be useful if a test needs to be temporarily disabled.
* `timeout` / `timeoutUnit` - sets a timeout for this test. If the test has not finished in that time then the test fails. Useful for code that is non-deterministic and might not finish.
* `timeout` - sets a timeout for this test. If the test has not finished in that time then the test fails. Useful for code that is non-deterministic and might not finish. Timeout is of type `Duration` which can be instantiated like `2.seconds`, `3.minutes` and so on.
* `tag` / `tags` - a list of String tags that can be set on a test. Then by invoking the test runner with a system property of testTags, you can control which tests are run. For example, tests that require a linux based O/S might be tagged with "linux" then gradle could be invoked with gradle test -DtestTags=linux. Another example might be tagging database tags that you only want to run on a server that has a database installed. Any test that has no tags is always run.

Examples of setting config:
Expand All @@ -354,7 +354,7 @@ class MyTests : WordSpec() {
"return the length of the string" {
"sammy".length shouldBe 5
"".length shouldBe 0
}.config(timeout=2, timeoutUnit=TimeUnit.SECONDS)
}.config(timeout = 2.seconds)
}
}
}
Expand Down Expand Up @@ -435,7 +435,7 @@ When testing future based code, it's handy to be able to say "I expect these ass
class MyTests : ShouldSpec() {
init {
should("do something") {
eventually(5, TimeUnit.SECONDS) {
eventually(5.seconds) {
// code here that should complete in 5 seconds but takes an indetermistic amount of time.
}
}
Expand Down

0 comments on commit 601b0cc

Please sign in to comment.