Sha256: bd4e34349578f0e50098696c62a49b9255b06232da26f30cef906527dce68b8f

Contents?: true

Size: 1.87 KB

Versions: 330

Compression:

Stored size: 1.87 KB

Contents

use "ponytest"

actor Main is TestList
  new create(env: Env) =>
    PonyTest(env, this)

  fun tag tests(test: PonyTest) =>
    test(_TestBobShout)
    test(_TestBobQuestion)
    test(_TestBobSilent)
    test(_TestBobDefault)

class iso _TestBobShout is UnitTest
  fun name(): String => "bob/Bob (Whoa, chill out!)"

  fun apply(h: TestHelper) =>
    let shout_resp: String = "Whoa, chill out!"

    h.assert_eq[String](shout_resp, Bob("WATCH OUT!"))
    h.assert_eq[String](shout_resp, Bob("WHAT THE HELL WERE YOU THINKING?"))
    h.assert_eq[String](shout_resp, Bob("1, 2, 3 GO!"))
    h.assert_eq[String](shout_resp, Bob("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"))

class iso _TestBobQuestion is UnitTest
  fun name(): String => "bob/Bob (Sure.)"

  fun apply(h: TestHelper) =>
    let ques_resp: String = "Sure."

    h.assert_eq[String](ques_resp, Bob("Does this cryogenic chamber make me look fat?"))
    h.assert_eq[String](ques_resp, Bob("You are, what, like 15?"))
    h.assert_eq[String](ques_resp, Bob("4?"))
    h.assert_eq[String](ques_resp, Bob("Wait! Hang on. Are you going to be OK?"))

class iso _TestBobSilent is UnitTest
  fun name(): String => "bob/Bob (Fine. Be that way!)"

  fun apply(h: TestHelper) =>
    let silent_resp: String = "Fine. Be that way!"

    h.assert_eq[String](silent_resp, Bob(""))
    h.assert_eq[String](silent_resp, Bob("   "))

class iso _TestBobDefault is UnitTest
  fun name(): String => "bob/Bob (Whatever.)"

  fun apply(h: TestHelper) =>
    let default_resp: String = "Whatever."

    h.assert_eq[String](default_resp, Bob("Tom-ay-to, tom-aaaah-to."))
    h.assert_eq[String](default_resp, Bob("Let's go make out behind the gym!"))
    h.assert_eq[String](default_resp, Bob("It's OK if you don't want to go to the DMV."))
    h.assert_eq[String](default_resp, Bob("1, 2, 3"))
    h.assert_eq[String](default_resp, Bob("Ending with ? means a question."))

Version data entries

330 entries across 330 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.179 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.178 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.177 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.176 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.175 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.174 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.173 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.172 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.171 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.170 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.169 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.167 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.166 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.165 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.164 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.163 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.162 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.161 tracks/pony/exercises/bob/test.pony
trackler-2.2.1.160 tracks/pony/exercises/bob/test.pony