Skip to content

Instantly share code, notes, and snippets.

@manveru
Created July 10, 2010 09:15
Show Gist options
  • Save manveru/470591 to your computer and use it in GitHub Desktop.
Save manveru/470591 to your computer and use it in GitHub Desktop.
iota github/manveru/kimochi % vows spec.coffee
/home/manveru/.node_libraries/.npm/vows/0.4.6/package/lib/vows/context.js:28
if (e) { that.emitter.emit('error', e) }
^
TypeError: Cannot call method 'emit' of null
at /home/manveru/.node_libraries/.npm/vows/0.4.6/package/lib/vows/context.js:28:47
at EventEmitter._tickCallback (node.js:50:25)
at node.js:255:9
zsh: exit 1 vows spec.coffee
iota github/manveru/kimochi % cat spec.coffee
vows: require 'vows'
assert: require 'assert'
Kimochi: require './kimochi'
model: Kimochi.connect 'vows_spec'
module.exports.foo: vows.describe 'Kimochi', {
'A model creates the database': {
topic: -> model.create @callback
'without errors': (result) ->
assert.deepEqual result, {doc: {ok: true}, ok: true}
}}, {
'A model destroys the database': {
topic: -> model.destroy @callback
'without errors': (result) ->
assert.deepEqual result, {doc: {ok: true}, ok: true}
}}
(function(){
var Kimochi, assert, model, vows;
vows = require('vows');
assert = require('assert');
Kimochi = require('./kimochi');
model = Kimochi.connect('vows_spec');
module.exports.foo = vows.describe('Kimochi', {
'A model creates the database': {
topic: function() {
return model.create(this.callback);
},
'without errors': function(result) {
return assert.deepEqual(result, {
doc: {
ok: true
},
ok: true
});
}
}
}, {
'A model destroys the database': {
topic: function() {
return model.destroy(this.callback);
},
'without errors': function(result) {
return assert.deepEqual(result, {
doc: {
ok: true
},
ok: true
});
}
}
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment