var $ = require('../')
  , assert = require('assert')

$.import('Foundation')
var pool = $.NSAutoreleasePool('alloc')('init')

var Obj = $.NSObject.extend('Obj')
Obj.addMethod('sel:', 'v@:@', function (self, _cmd, timer) {
  console.log('self:\t%s', self)
  console.log('timer:\t%s', timer)
  console.log('info:\t%s', timer('userInfo'))
  console.log()
}).register()

var timer = $.NSTimer('scheduledTimerWithTimeInterval', 2.0
                     ,'target', Obj('alloc')('init')
                     ,'selector', 'sel:'
                     ,'userInfo', $._('Info')
                     ,'repeats', 1)

$.NSRunLoop('mainRunLoop')('run')

@@ -155,16 +155,37 @@
 ('Obj')%0A
+  , invokeCount = 0%0A%0A
 Obj.addM
@@ -243,135 +243,134 @@
 %7B%0A  
-console.log('self:%5Ct%25s', self)%0A  console.log('timer:%5Ct%25s', timer)%0A  console.log('info:%5Ct%25s', timer('userInfo'))%0A  console.log()
+assert.equal('Info', timer('userInfo').toString())%0A  if (++invokeCount == 5) %7B%0A    timer('invalidate')%0A    process.exit(0)%0A  %7D
 %0A%7D).
@@ -441,11 +441,11 @@
 l', 
-2.0
+0.5
 %0A   
@@ -574,10 +574,8 @@
 ', $
-._
 ('In
@@ -616,16 +616,84 @@
 s', 1)%0A%0A
+process.on('exit', function () %7B%0A  assert.equal(invokeCount, 5)%0A%7D)%0A%0A
 $.NSRunL

Make test/nstimer.js be silent.