Skip to content

Instantly share code, notes, and snippets.

@canweriotnow
Created July 21, 2015 18:04
Show Gist options
  • Save canweriotnow/2ebe81765d2651d1c2b8 to your computer and use it in GitHub Desktop.
Save canweriotnow/2ebe81765d2651d1c2b8 to your computer and use it in GitHub Desktop.
Hello, Ponytest!
class HelloWorld
let hello: String = "Hello, "
new create() =>
hello
fun say_hello(who: String = "World"): String =>
hello.add(who)
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