Skip to content

Commit

Permalink
modify update_state method, update test
Browse files Browse the repository at this point in the history
  • Loading branch information
TLena committed Mar 1, 2014
1 parent f2d58ed commit 79854e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/participant.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Participant

update_state: (state) ->
throw new Error 'Participant\'s state can\'t be empty' unless state
throw new Error 'Participant\'s state must be a string' unless typeof state == 'string'
throw new Error 'Participant\'s state must be a string' unless typeof state is 'string'
@state = state

module.exports = Participant
4 changes: 2 additions & 2 deletions test/participant.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ describe 'Participant', ->
participant.check_task(first_task_name).should.be.ok

describe 'update_state', ->
it 'throw an error exception when argument is not a string', ->
it 'throws an error exception when argument is not a string', ->
-> participant.update_state(state:'new').should.throw Error
-> participant.update_state().should.throw Error
it 'update current participant`s state', ->
it 'updates current participant`s state', ->
state = 'new'
participant.update_state(state)
participant.state.should.be.equal state

0 comments on commit 79854e0

Please sign in to comment.