Skip to content

Commit

Permalink
bump sample app to currently available lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Wirtz committed Nov 23, 2020
1 parent d90ac7e commit 115df53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sample-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
implementation(kotlin("reflect"))
implementation("org.slf4j:slf4j-api:1.7.30")
implementation("ch.qos.logback:logback-classic:1.2.3")
implementation("de.swirtz:ktsRunner:0.0.9")
implementation("de.swirtz:ktsRunner:0.0.8")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
Expand Down
5 changes: 2 additions & 3 deletions sample-app/src/main/kotlin/de/swirtz/sample/SampleApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package de.swirtz.sample

import de.swirtz.ktsrunner.objectloader.KtsObjectLoader

fun main() {
fun readRandomValueFromScript(): Int {
println("Hello Kotlin Scripting World")
val i = KtsObjectLoader().load<Int>("val x = 10; x")
println(i)
return KtsObjectLoader().load("val x = 10; x")
}
12 changes: 12 additions & 0 deletions sample-app/src/test/kotlin/de/swirtz/sample/SampleAppTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package de.swirtz.sample

import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

class SampleAppTest
{
@Test
fun `can get random value from script`(){
assertThat(readRandomValueFromScript()).isEqualTo(10)
}
}

0 comments on commit 115df53

Please sign in to comment.