 
 exports.test_promises_in_objects = (test) ->
   bot = new TestCase(test, """
-    + *
-    - hello there <call>helper <star></call> with a <call>anotherHelper</call>
+    + my name is *
+    - hello there <call>helperWithPromise <star></call> with a <call>anotherHelperWithPromise</call>
   """)
 
-  input = "hello there"
-
-  bot.rs.setSubroutine("helper", (rs, args) ->
+  input = "my name is Rive"
+
+  bot.rs.setSubroutine("helperWithPromise", (rs, args) ->
+    console.error('args are', args);
+    test.ok(args.length is 1)
+    test.equal(args[0], "rive")
     return new Promise((resolve, reject) -> 
       resolve("stranger")
     )
   )
 
-  bot.rs.setSubroutine("anotherHelper", (rs, args) ->
+  bot.rs.setSubroutine("anotherHelperWithPromise", (rs, args) ->
     return new Promise((resolve, reject) -> 
       setTimeout () ->
         resolve("delay")


exports.test_function_in_setSubroutine = (test) ->
  bot = new TestCase(test, """
    + *
    - hello person<call>helper <star></call>
  """)

  input = "hello there"

  bot.rs.setSubroutine("helper", (rs, args) ->
    test.ok(args.length is 2)
    test.equal(rs, bot.rs)
    test.equal(args[0], "hello")
    test.equal(args[1], "there")
    test.done()
  )


    )
  )

  bot.rs.reply(bot.username, input).then (reply) ->
    test.equal(reply, "hello there stranger with a delay")
    test.done()