var Clearwing = require('../lib/clearwing.js'),
    should    = require('should');

var client,
    string = 'network.foo channel.#bar bah baz',
    array  = [ { network: 'foo' }, { channel: '#bar' }, 'bah', 'baz' ];

describe('Clearwing', function() {
	describe('.stringifyPropName', function() {
		it('should parse an array that matches string', function() {
			Clearwing.stringifyPropName(array).should.equal(string);
		});
	});

	describe('.parsePropName', function() {
		it('should parse a string that matches array', function() {
			Clearwing.parsePropName(string).should.eql(array);
		});
	});

	describe('#get and #set', function() {
		before(function() {
			client = new Clearwing();
		});

		it('should return undefined for undefined properties', function() {
			should.strictEqual(undefined, client.get('foo'));
			should.notStrictEqual(null, client.get('foo'));
		});

		it('should let you set and retrieve values', function() {
			client.set('foo', 'bar');
			client.get('foo').should.equal('bar');
		});
	});
});

@@ -1,12 +1,51 @@
 var 
+_         = require('underscore'),%0A    
 Clearwin
@@ -638,49 +638,8 @@
 );%0A%0A
-%09describe('#get and #set', function() %7B%0A%09
 %09bef
@@ -647,33 +647,32 @@
 re(function() %7B%0A
-%09
 %09%09client = new C
@@ -683,23 +683,62 @@
 wing();%0A
-%09
 %09%7D);%0A%0A
+%09describe('#get and #set', function() %7B%0A
 %09%09it('sh
@@ -1051,13 +1051,566 @@
 %7D);%0A%09%7D);
+%0A%0A%09describe('#on', function() %7B%0A%09%09it('sets Clearwing#_events%5Bevent%5D', function() %7B%0A%09%09%09var fn = function() %7B%7D;%0A%09%09%09client.on('foo', fn);%0A%09%09%09client._events%5B'foo'%5D.should.eql(%5B fn %5D);%0A%09%09%7D);%0A%09%7D);%0A%0A%09describe('#emit', function() %7B%0A%09%09it('should work', function(done) %7B%0A%09%09%09client._events%5B'test'%5D = %5B function() %7B done(); %7D %5D;%0A%09%09%09client.emit('test', 'foo');%0A%09%09%7D);%0A%0A%09%09it('should thrown an error if fewer than two arguments are supplied', function() %7B%0A%09%09%09_.bind(client.emit, client, 'foo').should.throw('Clearwing#emit() expects at least two arguments');%0A%09%09%7D);%0A%09%7D);
 %0A%7D);%0A

Add event tests