Skip to content

Commit

Permalink
Rename assert to okay.
Browse files Browse the repository at this point in the history
  • Loading branch information
flatheadmill committed Nov 25, 2018
1 parent c588afd commit 6390c23
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions t/readable.t.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('proof')(4, require('cadence')(prove))

function prove (async, assert) {
function prove (async, okay) {
var Staccato = { Readable: require('../readable') }
var delta = require('delta')
var stream = require('stream')
Expand All @@ -18,7 +18,7 @@ function prove (async, assert) {
gathered.push(buffer)
})
}, function () {
assert(Buffer.concat(gathered).toString(), 'a', 'gathered')
okay(Buffer.concat(gathered).toString(), 'a', 'gathered')
})
async(function () {
setImmediate(async())
Expand All @@ -34,7 +34,7 @@ function prove (async, assert) {
staccato.read(async())
staccato.destroy()
}, function () {
assert(staccato.destroy, 'destroyed and canceled')
okay(staccato.destroy, 'destroyed and canceled')
})
}, function () {
var through = new stream.PassThrough
Expand All @@ -43,8 +43,8 @@ function prove (async, assert) {
async([function () {
staccato.read(async())
}, function (error) {
assert(error.message, 'errored', 'threw error')
assert(staccato.destroy, 'errored and canceled')
okay(error.message, 'errored', 'threw error')
okay(staccato.destroy, 'errored and canceled')
}])
})
}
6 changes: 3 additions & 3 deletions t/staccato.t.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require('proof')(2, prove)

function prove (assert) {
function prove (okay) {
var Staccato = require('..')
console.log(Staccato)
assert(Staccato.Readable, 'readable required')
assert(Staccato.Writable, 'writable required')
okay(Staccato.Readable, 'readable required')
okay(Staccato.Writable, 'writable required')
}
10 changes: 5 additions & 5 deletions t/writable.t.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function write (chunk, encoding, callback) {

proof(4, cadence(prove))

function prove (async, assert) {
function prove (async, okay) {
var mkdirp = require('mkdirp'),
Staccato = { Writable: require('../writable') },
staccato
Expand All @@ -31,7 +31,7 @@ function prove (async, assert) {
mkdirp(path.join(__dirname, 'tmp'), async())
}, function () {
staccato = new Staccato.Writable(createWritable(write), false)
assert(staccato, 'create')
okay(staccato, 'create')
}, function () {
staccato.write(Buffer.alloc(1024), async())
}, function () {
Expand All @@ -43,19 +43,19 @@ function prove (async, assert) {
}, function () {
staccato.write(Buffer.alloc(1024), async())
}, function () {
assert(1, 'opened and drained')
okay('opened and drained')
staccato.end(async())
}, [function () {
var writable
staccato = new Staccato.Writable(writable = createWritable(write, 1), true)
writable.emit('error', new Error('foo'))
staccato.write(Buffer.alloc(1024), async())
}, function (error) {
assert(/^staccato#destroyed$/m.test(error.message), 'error caught')
okay(/^staccato#destroyed$/m.test(error.message), 'error caught')
}], function () {
staccato = new Staccato.Writable(createWritable(write, 1), true)
staccato.destroy()
assert(staccato.destroyed, 'destroyed')
okay(staccato.destroyed, 'destroyed')
staccato.destroy()
}, function () {
if (!('UNTIDY' in process.env)) {
Expand Down

0 comments on commit 6390c23

Please sign in to comment.