Skip to content

Commit

Permalink
Prepare 2.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrovgs committed Feb 26, 2019
2 parents 8765d9c + ee630f1 commit dc304f9
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

_Provide a description of the overall goal (you can usually copy the one from the issue)_

### How is it being implemented?
### :memo: How is it being implemented?

_Provide a description of the implementation_

### How can it be tested?
### :boom: How can it be tested?

_If it cannot be tested explain why._

- [ ] **Use case 1:** _A brief description of the use case that should be tested_
- [ ] **Use case 2:** _If the use case requires some complex steps, increase indentation_
- [ ] _Step 1_
- [ ] _Step 2_
- [ ] _Step 2_
2 changes: 1 addition & 1 deletion AndroidConsumer/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
maven { url uri('../../repo') }
}
dependencies {
classpath 'com.karumi.kotlinsnapshot:plugin:2.0.1-SNAPSHOT'
classpath 'com.karumi.kotlinsnapshot:plugin:2.1.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion AndroidConsumer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.3.21'
repositories {
google()
jcenter()
Expand Down
4 changes: 2 additions & 2 deletions KotlinConsumer/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.3.21'
repositories {
mavenCentral()
maven { url uri("../repo") }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.karumi.kotlinsnapshot:plugin:2.0.1-SNAPSHOT'
classpath "com.karumi.kotlinsnapshot:plugin:2.1.0"
}
}

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.karumi.kotlinsnapshot:plugin:2.0.0'
classpath 'com.karumi.kotlinsnapshot:plugin: version '2.1.0''
}
}
Expand Down Expand Up @@ -144,6 +144,12 @@ class CustomKotlinJsonSerialization: SerializationModule {

### Changelog

#### 2.1.0 Improve IntelliJ and JUnit 5 support:

* Support for nullable types.
* Improved IntelliJ Support.
* Add JUnit 5 Support

#### 2.0.0 Improve the serialization format:

* We've replaced the old serialization format with a custom JSON format letting the user review the snapshots easily and unify the format. **If you update the library to a 2.X version or greater you'll have to record all your tests again.**
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.3.21'
repositories {
maven {
url "https://plugins.gradle.org/m2/"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
null
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
null
4 changes: 2 additions & 2 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
group 'com.karumi.kotlinsnapshot'
version '2.0.1-SNAPSHOT'
version '2.1.0'

buildscript {
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.3.21'

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions core/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ POM_NAME=core
POM_ARTIFACT_ID=core
POM_PACKAGING=jar

VERSION_NAME=2.0.1-SNAPSHOT
VERSION_CODE=020001
VERSION_NAME=2.1.0
VERSION_CODE=020000
GROUP=com.karumi.kotlinsnapshot

POM_DESCRIPTION=Snapshot Testing framework for Kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class KotlinSnapshot(
snapshotsFolder
)

fun matchWithSnapshot(value: Any, snapshotName: String? = null) {
fun matchWithSnapshot(value: Any?, snapshotName: String? = null) {
camera.matchWithSnapshot(value, snapshotName)
}
}

private val camera = Camera(KotlinSerialization(), TestCaseExtractor())

fun Any.matchWithSnapshot(snapshotName: String? = null) {
fun Any?.matchWithSnapshot(snapshotName: String? = null) {
camera.matchWithSnapshot(this, snapshotName)
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ class CameraTest {
val json = """{"name":"gabriel","id":5}"""
json.matchWithSnapshot("should take snapshot of a json string")
}

@Test
fun should_take_snapshots_of_null_values() {
val nullString: String? = null
nullString.matchWithSnapshot("should take snapshots of null values")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ class KotlinSerializationTest {
anyNestedArray.matchWithSnapshot()
}

@Test
fun `should serialize null values`() {
snap.matchWithSnapshot(null)
}

enum class Primitives { INT, DOUBLE, LONG }

class User(val id: Int, val name: String)
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ POM_NAME=core
POM_ARTIFACT_ID=core
POM_PACKAGING=jar

VERSION_NAME=2.0.1-SNAPSHOT
VERSION_CODE=020001
VERSION_NAME=2.1.0
VERSION_CODE=020100
GROUP=com.karumi.kotlinsnapshot

POM_DESCRIPTION=Snapshot Testing framework for Kotlin
Expand Down
5 changes: 3 additions & 2 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
group 'com.karumi.kotlinsnapshot'
version '2.0.1'

version '2.1.0'

buildscript {
ext.kotlin_version = '1.2.10'
ext.kotlin_version = '1.3.21'

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ POM_NAME=plugin
POM_ARTIFACT_ID=plugin
POM_PACKAGING=jar

VERSION_NAME=2.0.1-SNAPSHOT
VERSION_CODE=020001
VERSION_NAME=2.1.0
VERSION_CODE=020100
GROUP=com.karumi.kotlinsnapshot

POM_DESCRIPTION=Snapshot Testing framework for Kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ open class KotlinSnapshotPlugin : Plugin<Project> {
project.gradle.addListener(object : DependencyResolutionListener {
override fun beforeResolve(dependencies: ResolvableDependencies?) {
val dependency = project.dependencies
.create("com.karumi.kotlinsnapshot:core:2.0.1-SNAPSHOT")
.create("com.karumi.kotlinsnapshot:core:2.1.0")
project.dependencies.add("testImplementation", dependency)
project.gradle.removeListener(this)
}
Expand Down

0 comments on commit dc304f9

Please sign in to comment.