<commit_before>## Versions

### Master Branch (0.1-SNAPSHOT)

Master branch corresponds to 1.0.0-beta-4584

### 0.1.x Releases

First stable release. Only critical bug fixes and updates to work with released versions of Kotlin will be performed.
Please note that branch names do not correspond to the artifact versions. 

## Artifacts and versions

Check http://repository.jetbrains.com for available artifacts

See [Documentation Site](http://jetbrains.github.io/spek) for more information<commit_msg>Update the README<commit_after>This fork of Spek is intended to address some of the problems with the existing version of the library.  

1. **Execution order** - Fixes bugs related to the execution order of `on` blocks (see [#39](https://github.com/JetBrains/spek/issues/39), [#32](https://github.com/JetBrains/spek/issues/32)) .  Improves setup/teardown features for tests: `describe` body blocks are executed before each `it`, and `afterEach` blocks are added.
1. **Test pollution** - Each `it` is created in a clean context, and all relevant setup code (the body of each parent `describe`) is executed for *each* test.  (see [#32](https://github.com/JetBrains/spek/issues/32))
1. **Simpler/more flexible DSL** - This reduces the overhead in writing simple tests, and allows for more sophisticated test structures, like arbitrary nesting depth
  - outer `init` is no longer necessary
  - `given`, `on` replaced with `describe`
  - `describe`s can be nested
  - removed assertions `should`, etc -- use kotlin's `assertEquals`, or other library ([AssertJ](http://joel-costigliola.github.io/assertj/), [HamKrest](https://github.com/npryce/hamkrest), etc) instead

## How to use
1. Download the [jar](https://github.com/lkogler/spek/releases/download/v0.alpha1/spek-core.jar)
2. Make a folder called testLibs in your project and add the jar
3. Update your `build.gradle`: Remove the current `spek` dependency, and add the following:

  ```groovy
  testCompile 'junit:junit:4.12'  // if not already present
  testCompile "org.jetbrains.kotlin:kotlin-test:${kotlin_version}"  // if not already present
  testCompile fileTree(dir: 'testLibs', include: ['*.jar'])
  ```

## Example

```kotlin
class ExampleTest : Spek({
    describe("a calculator") {
        val calculator = SampleCalculator()
        
        describe("addition") {
            val sum = calculator.sum(2, 4)
            
            it("should return the result of adding the first number to the second number") {
                assertEquals(6, sum)
            }
            
            // Example of a failing test
            it("should fail") {
                assertEquals(7, sum)
            }
        }
        
        describe("subtraction") {
            val subtract = calculator.subtract(4, 2)

            it("should return the result of subtracting the second number from the first number") {
                assertEquals(2, subtract)
            }
        }
    }
})
```

{'fraction_non_alphanumeric': 0.10964467005076142, 'fraction_numerical': 0.013874788494077835, 'mean_word_length': 3.077241379310345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2574273', 'n_tokens_mistral': 879, 'n_tokens_neox': 812, 'n_words': 302}