Skip to content

Commit 83dbd98

Browse files
committed
Step 7.23: Delete circle instances in tests
1 parent 5b394cb commit 83dbd98

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

resources/scripts/specs/engine/geometry/circle.js

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ describe("Engine.Geometry.Circle class", function() {
33
this.circle = new Engine.Geometry.Circle(1, 1, 5, 0, 1.5 * Math.PI);
44
});
55

6+
afterEach(function () {
7+
this.circle.delete();
8+
});
9+
610
describe("getX method", function() {
711
describe("given inranged rad", function() {
812
it("returns x", function() {
@@ -64,6 +68,8 @@ describe("Engine.Geometry.Circle class", function() {
6468
{ x: -2, y: -3 },
6569
{ x: -2, y: 5 }
6670
]);
71+
72+
circle.delete();
6773
});
6874
});
6975

@@ -74,6 +80,8 @@ describe("Engine.Geometry.Circle class", function() {
7480
expect(this.circle.getCircleIntersection(circle)).toEqual([
7581
{ x: -2, y: 5 }
7682
]);
83+
84+
circle.delete();
7785
});
7886
});
7987

@@ -84,20 +92,24 @@ describe("Engine.Geometry.Circle class", function() {
8492
expect(this.circle.getCircleIntersection(circle)).toEqual([
8593
{ x: -4, y: 1 }
8694
]);
95+
96+
circle.delete();
8797
});
8898
});
8999

90100
describe("given outer circle", function() {
91101
it("returns nothing", function() {
92102
let circle = new Engine.Geometry.Circle(10, 10, 2, 0, 2 * Math.PI);
93103
expect(this.circle.getCircleIntersection(circle)).toBeUndefined();
104+
circle.delete();
94105
});
95106
});
96107

97108
describe("given inner circle", function() {
98109
it("nothing", function() {
99110
let circle = new Engine.Geometry.Circle(1, 1, 2, 0, 2 * Math.PI);
100111
expect(this.circle.getCircleIntersection(circle)).toBeUndefined();
112+
circle.delete();
101113
});
102114
});
103115
});

resources/scripts/specs/engine/geometry/polygon.js

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ describe("Engine.Geometry.Polygon class", function() {
6464
{ x: 2, y: 0 },
6565
{ x: 0, y: 2 }
6666
]);
67+
68+
circle.delete();
6769
});
6870
});
6971

@@ -74,6 +76,8 @@ describe("Engine.Geometry.Polygon class", function() {
7476
expect(this.polygon.getCircleIntersection(circle)).toEqual([
7577
{ x: 2, y: 0 }
7678
]);
79+
80+
circle.delete();
7781
});
7882
});
7983

@@ -84,20 +88,24 @@ describe("Engine.Geometry.Polygon class", function() {
8488
expect(this.polygon.getCircleIntersection(circle)).toEqual([
8589
{ x: 0, y: 3 }
8690
]);
91+
92+
circle.delete();
8793
});
8894
});
8995

9096
describe("given outer circle", function() {
9197
it("returns nothing", function() {
9298
let circle = new Engine.Geometry.Circle(10, 10, 2, 0, 2 * Math.PI);
9399
expect(this.polygon.getCircleIntersection(circle)).toBeUndefined();
100+
circle.delete();
94101
});
95102
});
96103

97104
describe("given inner circle", function() {
98105
it("nothing", function() {
99106
let circle = new Engine.Geometry.Circle(2.5, 2.5, 2, 0, 2 * Math.PI);
100107
expect(this.polygon.getCircleIntersection(circle)).toBeUndefined();
108+
circle.delete();
101109
});
102110
});
103111
});

0 commit comments

Comments
 (0)