Permalink
Browse files

Fix tests, use expresso

  • Loading branch information...
1 parent e6a71d0 commit 83e1173382332e3e3f70600fbc422383364d0339 @nh2 nh2 committed Apr 10, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 {spec → test}/levenshtein.spec.js
@@ -1,20 +1,22 @@
// Tests
-var Levenshtein = require( '../lib/Levenshtein' )
+// Run with `expresso` from the toplevel directory.
+var Levenshtein = require( '../lib/levenshtein' )
+var assert = require( 'assert' )
-exports['test Levenshtein correctness'] = function( assert ) {
+exports['test Levenshtein correctness'] = function() {
var l1 = new Levenshtein( 'kitten', 'sitting' )
, l2 = new Levenshtein( 'Saturday', 'Sunday' )
assert.equal( 3, l1.distance, 'kitten <=> sitting' )
assert.equal( 3, l2.distance, 'Saturday <=> Sunday' )
}
-exports['test Levenshtein can be coerced to a number'] = function( assert ) {
+exports['test Levenshtein can be coerced to a number'] = function() {
var l1 = new Levenshtein( 'kitten', 'sitting' )
assert.equal( l1.distance, l1 + 0 )
}
-exports['test Levenshtein can be coerced to a string'] = function( assert ) {
+exports['test Levenshtein can be coerced to a string'] = function() {
var l1 = new Levenshtein( 'kitten', 'sitting' )
assert.equal( l1.inspect(), new String(l1) )
}

0 comments on commit 83e1173

Please sign in to comment.