Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Counter
- count: 0
- constructor: ->
- @count = 0
- increment: ->
- @count++
- decrement: ->
- @count--
- reset: ->
- @count = 0
- root = exports ? this
- root.Counter = Counter
- describe("Counter", ->
- counter = new Counter
- it("shold have 0 as a count variable at first", ->
- expect(counter.count).toBe(0)
- )
- describe('increment()', ->
- it("should count up from 0 to 1", ->
- expect(counter.increment()).toBe(1)
- )
- )
- )
- class Counter
- count: 0
- constructor: ->
- @count = 0
- increment: ->
- ++@count
- decrement: ->
- --@count
- reset: ->
- @count = 0
- root = exports ? this
- root.Counter = Counter
- class Counter
- count: 0
- constructor: ->
- @count = 0
- increment: ->
- @count++
- @count
- decrement: ->
- @count--
- @count
- reset: ->
- @count = 0
- root = exports ? this
- root.Counter = Counter
- describe('increment()', ->
- it("should count up from 0 to 1", ->
- expect(counter.count).toBe(0)
- counter.increment()
- expect(counter.count).toBe(1)
- )
- )
Add Comment
Please, Sign In to add comment