2014-03-09 06:43:36 +01:00
|
|
|
var Script = require('../src/script.js')
|
|
|
|
var assert = require('assert')
|
|
|
|
|
|
|
|
describe('Script', function() {
|
|
|
|
describe('constructor', function() {
|
|
|
|
it('works for a byte array', function() {
|
|
|
|
assert.ok(new Script([]))
|
|
|
|
})
|
|
|
|
|
2014-03-17 09:13:49 +01:00
|
|
|
it('works when nothing is passed in', function() {
|
|
|
|
assert.ok(new Script())
|
|
|
|
})
|
|
|
|
|
2014-03-09 06:43:36 +01:00
|
|
|
it('throws an error when input is not an array', function() {
|
2014-03-17 09:13:49 +01:00
|
|
|
assert.throws(function(){ new Script({}) })
|
2014-03-09 06:43:36 +01:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|