Merge remote-tracking branch 'github/master'

This commit is contained in:
Erik C. Thauvin 2017-11-04 12:09:21 -07:00
commit a7ec86d274
2 changed files with 21 additions and 8 deletions

View file

@ -27,5 +27,11 @@ jobs:
key: kobalt-dependencies-{{ checksum "kobalt/src/Build.kt" }}
- run:
name: Assemble
command: ./kobaltw assemble
name: Assemble & Test
command: ./kobaltw assemble test
- store_artifacts:
path: kobaltBuild/test-output/
destination: test-output
- store_test_results:
path: kobaltBuild/test-output/

View file

@ -34,15 +34,22 @@ package net.thauvin.erik.pinboard
import org.testng.Assert
import org.testng.annotations.Test
import java.io.FileInputStream
import java.util.*
import java.nio.file.Files
import java.nio.file.Paths
import java.util.Properties
class PinboardPosterTest {
private val url = "http://www.foo.com/"
private val desc = "This is a test."
private val p = Properties().apply { FileInputStream("local.properties").use { fis -> load(fis) } }
private val apiToken = p.getProperty("pinboard-api-token")
@Test
private val localProps = Paths.get("local.properties")
private val apiToken = if (Files.exists(localProps)) {
val p = Properties().apply { Files.newInputStream(localProps).use { fis -> load(fis) }}
p.getProperty("pinboard-api-token", "")
} else {
System.getenv("PINBOARD_API_TOKEN")
}
@Test
fun testAddPin() {
val poster = PinboardPoster("")
@ -70,4 +77,4 @@ class PinboardPosterTest {
Assert.assertFalse(poster.deletePin("foo.com"), "url: foo.com")
}
}
}