var chai = require('chai');
chai.should();

var EventEmitter = process.EventEmitter;
var MatchSet = require('../matchset');

describe("match set", function () {

  var events;

  beforeEach(function () {
    events = new EventEmitter();
  });

  it('has initial score 0-0', function () {
    var s = new MatchSet(events);
    s.score.should.equal('0-0');
  });

  it('ups score on event', function () {
    var s = new MatchSet(events);

    events.emit('score', {
      point: 'a'
    });

    s.score.should.equal('1-0');
  });
});

@@ -16,14 +16,14 @@
 ire(
-'
+%22
 chai
-'
+%22
 );%0Ac
@@ -101,17 +101,17 @@
 require(
-'
+%22
 ../match
@@ -113,17 +113,17 @@
 matchset
-'
+%22
 );%0A%0Adesc
@@ -242,17 +242,17 @@
 ;%0A%0A  it(
-'
+%22
 has init
@@ -264,17 +264,17 @@
 core 0-0
-'
+%22
 , functi
@@ -344,13 +344,13 @@
 ual(
-'0-0'
+%220-0%22
 );%0A 
@@ -364,13 +364,17 @@
  it(
-'
+%22
 ups 
+a's 
 scor
@@ -383,17 +383,17 @@
 on event
-'
+%22
 , functi
@@ -455,15 +455,15 @@
 mit(
-'
+%22
 score
-'
+%22
 , %7B%0A
@@ -479,11 +479,11 @@
 nt: 
-'a'
+%22a%22
 %0A   
@@ -517,13 +517,244 @@
 ual(
-'1-0'
+%221-0%22);%0A  %7D);%0A%0A  it(%22ups a and b's score on event%22, function () %7B%0A    var s = new MatchSet(events);%0A%0A    events.emit(%22score%22, %7B%0A      point: %22a%22%0A    %7D);%0A    events.emit(%22score%22, %7B%0A      point: %22b%22%0A    %7D);%0A%0A    s.score.should.equal(%221-1%22
 );%0A 

Test both players' score.