Created
July 21, 2015 18:04
-
-
Save canweriotnow/2ebe81765d2651d1c2b8 to your computer and use it in GitHub Desktop.
Hello, Ponytest!
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
class HelloWorld | |
let hello: String = "Hello, " | |
new create() => | |
hello | |
fun say_hello(who: String = "World"): String => | |
hello.add(who) |
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
use "ponytest" | |
actor Main | |
new create(env: Env) => | |
var test = PonyTest(env) | |
test(recover _TestHelloWorld end) | |
test.complete() | |
class _TestHelloWorld iso is UnitTest | |
""" | |
Test Hello World | |
""" | |
fun name(): String => "helloworld/HelloWorld" | |
fun apply(h: TestHelper): TestResult => | |
let hello: HelloWorld = HelloWorld.create() | |
h.expect_eq[String]("Hello, World", hello.say_hello()) | |
h.expect_eq[String]("Hello, George", hello.say_hello("George")) | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment