<commit_before>This section will guide you through migrating `1.x` tests to `2.x`.

Both versions implement (albeit differently) a JUnit Platform `TestEngine`. `1.x` has an unique id (engine name) `spek` while `2.x`
has `spek2`, this allows having `1.x` and `2.x` tests in the same project.

!!! info "Sample configuration for a gradle based project"
    ```groovy
    test {
        useJUnitPlatform {
            includeEngines 'spek', 'spek2', 'some-other-test-engine'
        }
    }
    ```

## Maven coordinates
The table below shows the equivalent `1.x` and `2.x` artifacts.

| 1.x                                             | 2.x                                          |
|-------------------------------------------------|----------------------------------------------|
| `org.jetbrains.spek:spek-api`                   | `org.spekframework.spek2:spek-dsl-jvm`       |
| `org.jetbrains.spek:spek-junit-platform-engine` | `org.spekframework.spek2:spek-runner-junit5` |

## Base package
The base package is now `org.spekframework.spek2`, but since most of the API has change it's not easy as replacing
`org.jetbrains.spek` with the new base package.

## DSL changes
`2.x` introduces two distinct and completely isolated testing styles: `specification` and `gherkin`, mixing and matching
different synonyms is not allowed.

### describe, context, it
This `1.x` style is the most straightforward to migrate, adding an import to
`org.spekframework.spek2.specification.describe` should work in most cases. However, a major difference is `context` and `it` are not allowed in the root
scope, you have to either wrap them in a `describe` or for `context` rename it to `describe`.

```kotlin
object SetSpec: Spek({
    val set by memoized { mutableSetOf<String>() }

    context("is empty") {
        it("should have a size of 0") {
            assertEquals(0, set.size)
        }

        it("should throw when first is invoked") {
            assertFailsWith(NoSuchElementException::class) {
                set.first()
            }
          }
      }
  })
```

For example, the `2.x` equivalent for the test above is:

```kotlin
import org.spekframework.spek2.style.specifcation.describe
import org.spekframework.spek2.Spek

object SetSpec: Spek({
    describe("A set") {
        val set by memoized { mutableSetOf<String>() }

        context("is empty") {
            it("should have a size of 0") {
                assertEquals(0, set.size)
            }
<commit_msg>fix typo specification instead of specifcation (#703)<commit_after>This section will guide you through migrating `1.x` tests to `2.x`.

Both versions implement (albeit differently) a JUnit Platform `TestEngine`. `1.x` has an unique id (engine name) `spek` while `2.x`
has `spek2`, this allows having `1.x` and `2.x` tests in the same project.

!!! info "Sample configuration for a gradle based project"
    ```groovy
    test {
        useJUnitPlatform {
            includeEngines 'spek', 'spek2', 'some-other-test-engine'
        }
    }
    ```

## Maven coordinates
The table below shows the equivalent `1.x` and `2.x` artifacts.

| 1.x                                             | 2.x                                          |
|-------------------------------------------------|----------------------------------------------|
| `org.jetbrains.spek:spek-api`                   | `org.spekframework.spek2:spek-dsl-jvm`       |
| `org.jetbrains.spek:spek-junit-platform-engine` | `org.spekframework.spek2:spek-runner-junit5` |

## Base package
The base package is now `org.spekframework.spek2`, but since most of the API has change it's not easy as replacing
`org.jetbrains.spek` with the new base package.

## DSL changes
`2.x` introduces two distinct and completely isolated testing styles: `specification` and `gherkin`, mixing and matching
different synonyms is not allowed.

### describe, context, it
This `1.x` style is the most straightforward to migrate, adding an import to
`org.spekframework.spek2.specification.describe` should work in most cases. However, a major difference is `context` and `it` are not allowed in the root
scope, you have to either wrap them in a `describe` or for `context` rename it to `describe`.

```kotlin
object SetSpec: Spek({
    val set by memoized { mutableSetOf<String>() }

    context("is empty") {
        it("should have a size of 0") {
            assertEquals(0, set.size)
        }

        it("should throw when first is invoked") {
            assertFailsWith(NoSuchElementException::class) {
                set.first()
            }
          }
      }
  })
```

For example, the `2.x` equivalent for the test above is:

```kotlin
import org.spekframework.spek2.style.specification.describe
import org.spekframework.spek2.Spek

object SetSpec: Spek({
    describe("A set") {
        val set by memoized { mutableSetOf<String>() }

        context("is empty") {
            it("should have a size of 0") {
                assertEquals(0, set.size)
            }

{'fraction_non_alphanumeric': 0.14234234234234233, 'fraction_numerical': 0.011011011011011011, 'mean_word_length': 2.267495094833224, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '574576', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1407, 'n_words': 486}