-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshapes_spec.js
30 lines (23 loc) · 959 Bytes
/
shapes_spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var Shape = require('./shapes');
describe("Putting our shape constructor through the ringer", function(){
it('the shape can tell us its name', function(){
var s1 = new Shape('square');
expect(square.name).toBeDefined('square');
});
xit('A triangle can tell us its sides!', function(){
var tri = new Shape('triangle', 3);
expect(tri.sides).toEqual(3);
})
xit('A triangle can tell us about its self!', function(){
var tri = new Shape('triangle', 3, 'red');
expect(tri.getInfo()).toEqual("I am a red triangle with 3 sides!");
})
xit('A square can tell us about its self!', function(){
var square = new Shape('square', 4, 'blue');
expect(square.getInfo()).toEqual("I am a blue square with 4 sides!");
})
xit('A square can change color', function(){
var square = new Shape('square', 4, 'blue');
expect(square.updateColor('orange')).toEqual({ name : 'square', sides : 4, color : 'orange' });
})
})