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

$.import('Foundation')
$.NSAutoreleasePool('alloc')('init')

// suppress the "unrecognized selector sent to class" messages on stderr
fs.closeSync(2)

assert.throws(function () {
  $.NSObject('nonexistantMethod')
})

try {
  $.NSObject('nonexistantMethod')
} catch (e) {
  assert.equal('NSInvalidArgumentException', e('name'))
}

@@ -288,16 +288,23 @@
 d')%0A%7D)%0A%0A
+var e;%0A
 try %7B%0A  
@@ -348,15 +348,27 @@
 ch (
+_
 e) %7B%0A  
+e = _e;%0A%7D%0A%0A
 asse
@@ -417,10 +417,8 @@
 name'))%0A
-%7D%0A

make exception-bad-selector test better