Skip to content

Instantly share code, notes, and snippets.

@blambeau
Created March 4, 2014 17:00
Show Gist options
  • Save blambeau/9350599 to your computer and use it in GitHub Desktop.
Save blambeau/9350599 to your computer and use it in GitHub Desktop.
describe 'with an array with non bytes', ->
arg = [2, 4, -12]
subject =
try
type.dress(arg)
catch e
e
it 'should raise an error', ->
subject.should.be.an.instanceof(TypeError)
subject.message.should.equal("Invalid value `-12` for Byte")
it 'should have correct location', ->
subject.location.should.equal("2")
describe 'with an array with duplicates', ->
arg = [2, 4, 2]
subject =
try
type.dress(arg)
catch e
e
it 'should raise an error', ->
subject.should.be.an.instanceof(TypeError)
subject.message.should.equal("Duplicate value `2`")
it 'should have correct location', ->
subject.location.should.equal("2")
@blambeau
Copy link
Author

blambeau commented Mar 4, 2014

  1. SetType#dress when invalid with an array with non bytes should raise an error
    Message:
    AssertionError: expected [ 2, 4, 2 ] to be an instance of TypeError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment