Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Commit

Permalink
Added todo tests for the most of the remaining matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Remeika committed Jan 29, 2011
1 parent 8659c79 commit 82cdc6e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
36 changes: 36 additions & 0 deletions spec/matchers_spec.js
Expand Up @@ -6,6 +6,42 @@ var footest = foounit.require(':src/foo-unit');
foounit.add(function (kw){ with(kw){
describe('foounit.matchers', function (){

describe('.throwError', function (){
it('asserts that an error is thrown', function (){
throw new Error('todo');
});
});

describe('.beGt', function (){
it('asserts expected is greater than actual', function (){
throw new Error('todo');
});
});

describe('.beLt', function (){
it('asserts expected is less than actual', function (){
throw new Error('todo');
});
});

describe('.beTrue', function (){
it('asserts that actual is === true', function (){
throw new Error('todo');
});
});

describe('.beFalse', function (){
it('asserts that actual is === false', function (){
throw new Error('todo');
});
});

describe('.include', function (){
it('asserts that the actual array has an element === to expected', function (){
throw new Error('todo');
});
});

describe('.be', function (){
it('does a strict equal', function (){
var matcher = new footest.keywords.be();
Expand Down
11 changes: 11 additions & 0 deletions src/matchers.js
Expand Up @@ -2,6 +2,17 @@ if (foounit.hostenv.type == 'node'){
var assert = require('assert');
}

/**
* Asserts that a function throws an error
*/
foounit.addKeyword('throwError', function (){
this.match = function (expected, actual){
// actual == block
// expected == error
assert.throws(actual, expected);
}
});

/**
* Asserts type and object
*/
Expand Down

0 comments on commit 82cdc6e

Please sign in to comment.