# KotlinTest 2.0 released

**URL:** <https://discuss.kotlinlang.org/t/kotlintest-2-0-released/2465>\
**Category:** Uncategorized\
**Created:** [April 4, 2017, 7:21am UTC](https://discuss.kotlinlang.org/t/kotlintest-2-0-released/2465 "2017-04-04T07:21:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![medium](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/medium/32/10404_2.png) [@medium](https://discuss.kotlinlang.org/u/medium)\
**Post date:** [April 4, 2017, 7:21am UTC](https://discuss.kotlinlang.org/t/kotlintest-2-0-released/2465/1 "2017-04-04T07:21:51Z")

</div>

[KotlinTest 2.0](https://github.com/kotlintest/kotlintest/) was released! It brings new features and polishing.

Syntax can be even more conscise with a lambda passed to the Spec constructor:

```
class StringSpecExample : StringSpec({

    "strings.size should return size of string" {
        "hello" should haveLength(5)
    }

})

```

The new [interceptors](https://github.com/kotlintest/kotlintest/blob/master/doc/reference.md#interceptors-) allow to execute code before and after a test, a class or all classes.

```
override fun interceptTestCase(context: TestCaseContext, test: () -> Unit) {
    // before
    val started = System.currentTimeMillis()

    test() // don't forget to call test()!

    // after
    val time = System.currentTimeMillis() - started
    println("time [ms]: $time")
} 

```

- Simplified ability to add custom matchers. Simple implement Matcher interface.
- Some new matchers like `between(2, 5)`
- Typed [tags](https://github.com/kotlintest/kotlintest/blob/master/doc/reference.md#grouping-tests-with-tags) that can be included or excluded from the tests to be executed.
- Improved documentation.
