Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. describe 'Box', ->
  2.  
  3. beforeEach ->
  4. box = new Box
  5. top : 200
  6. right : 400
  7. bottom : 400
  8. left : 100
  9.  
  10.  
  11. it 'should have 0 values by default', ->
  12. box = new Box
  13.  
  14. expect(box.top).toBe 0
  15. expect(box.right).toBe 0
  16. expect(box.bottom).toBe 0
  17. expect(box.left).toBe 0
  18.  
  19.  
  20. it 'should have correct values', ->
  21. expect(box.top).toBe 200
  22. expect(box.right).toBe 400
  23. expect(box.bottom).toBe 400
  24. expect(box.left).toBe 100
  25.  
  26.  
  27. it 'should return correct width', ->
  28. expect(box.getWidth()).toBe 300
  29.  
  30.  
  31. it 'should return correct height', ->
  32. expect(box.getHeight()).toBe 200
  33.  
  34.  
  35. it 'should scale the box correctly', ->
  36. box.scale 2
  37.  
  38. expect(box.top).toBe 400
  39. expect(box.right).toBe 800
  40. expect(box.bottom).toBe 800
  41. expect(box.left).toBe 200
  42.  
  43.  
  44. it 'should return correct width and height after box scaled', ->
  45. box.scale 2
  46.  
  47. expect(box.getWidth()).toBe 600
  48. expect(box.getHeight()).toBe 400
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement