Skip to content

Commit

Permalink
bump Kotlin version, some other minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Jun 30, 2017
1 parent 288ac33 commit 987e416
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
group 'com.github.sanity'
version '0.2.9'
version '0.2.10'

buildscript {
ext.kotlin_version = '1.1.1'
ext.kotlin_version = '1.1.3'
ext.dokka_version = '0.9.9'

repositories {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/github/sanity/shoebox/View.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class View<T : Any>(val references: Shoebox<Reference>,
removeValue(viewKey, key)
null
} else {
KeyValue<T>(key, v)
KeyValue(key, v)
}
}?.toSet() ?: Collections.emptySet()
}
Expand Down Expand Up @@ -144,7 +144,7 @@ class View<T : Any>(val references: Shoebox<Reference>,
fun addKey(key: String) = Reference(keys.plus(key))
}

fun orderedSet(key : String, comparator : Comparator<T> = compareBy {it.hashCode()}) = OrderedViewSet<T>(this, key, comparator)
fun orderedSet(key : String, comparator : Comparator<T> = compareBy {it.hashCode()}) = OrderedViewSet(this, key, comparator)
}


Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/com/github/sanity/shoebox/ShoeboxSpec.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.github.sanity.shoebox

import com.github.sanity.shoebox.stores.MemoryStore
import io.kotlintest.matchers.shouldBe
import io.kotlintest.matchers.shouldEqual
import io.kotlintest.specs.FreeSpec
import java.util.concurrent.atomic.AtomicInteger

Expand Down Expand Up @@ -131,6 +133,4 @@ class ShoeboxSpec : FreeSpec() {

data class TestData(val one: Int, val two: Int)

override fun afterAll() {
}
}
3 changes: 3 additions & 0 deletions src/test/kotlin/com/github/sanity/shoebox/ViewSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import com.github.sanity.shoebox.data.Gender.FEMALE
import com.github.sanity.shoebox.data.Gender.MALE
import com.github.sanity.shoebox.data.User
import com.github.sanity.shoebox.stores.MemoryStore
import io.kotlintest.matchers.beEmpty
import io.kotlintest.matchers.should
import io.kotlintest.matchers.shouldEqual
import io.kotlintest.specs.FreeSpec
import java.lang.AssertionError
import java.util.concurrent.atomic.AtomicInteger
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.github.sanity.shoebox.stores

import com.github.sanity.shoebox.ShoeboxSpec
import io.kotlintest.matchers.be
import io.kotlintest.matchers.gt
import io.kotlintest.matchers.shouldBe
import io.kotlintest.matchers.shouldEqual
import io.kotlintest.matchers.shouldThrow
import io.kotlintest.specs.FreeSpec
import java.nio.file.Files
import java.nio.file.attribute.FileTime
Expand Down Expand Up @@ -41,7 +44,7 @@ class DirectoryStoreSpec : FreeSpec() {
}
Files.setLastModifiedTime(lockFilePath, FileTime.fromMillis(System.currentTimeMillis() - 60000))
DirectoryStore<ShoeboxSpec.TestData>(dir, ShoeboxSpec.TestData::class)
Files.getLastModifiedTime(lockFilePath).toMillis() should be gt (System.currentTimeMillis() - 5000)
Files.getLastModifiedTime(lockFilePath).toMillis() shouldBe gt (System.currentTimeMillis() - 5000)
}
}
val object1 = ShoeboxSpec.TestData(1, 2)
Expand Down

0 comments on commit 987e416

Please sign in to comment.