Created
December 14, 2017 20:21
-
-
Save AlexeySoshin/206372218f0008ada0d518515b65b576 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@org.testng.annotations.Test | |
fun testStrategy() { | |
val someAnimal = UncertainAnimal() | |
val output = captureOutput { | |
someAnimal.makeSound() | |
someAnimal.makeSound = fun () { | |
println("Woof!") | |
} | |
someAnimal.makeSound() | |
} | |
assertEquals(listOf("Meow!", "Woof!"), output) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment