8000 Merge pull request #23 from CoolCyberBrain/patch-2 · wolfwithcode/design-patterns-JS@d0eedab · GitHub
[go: up one dir, main page]

Skip to content

Commit d0eedab

Browse files
authored
Merge pull request fbeline#23 from CoolCyberBrain/patch-2
Corrected typo "cabbinet" to "cabinet"
2 parents bb9ab86 + f79c838 commit d0eedab

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/structural/composite/composite_es6.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class Composite extends Equipment {
3535
}
3636
}
3737

38-
class Cabbinet extends Composite {
38+
class Cabinet extends Composite {
3939
constructor() {
4040
super();
41-
this.setName('cabbinet');
41+
this.setName('cabinet');
4242
}
4343
}
4444

@@ -67,4 +67,4 @@ class Memory extends Equipment {
6767
}
6868
}
6969

70-
export { Cabbinet, FloppyDisk, HardDrive, Memory };
70+
export { Cabinet, FloppyDisk, HardDrive, Memory };

test/composite-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const [EquipmentComposition, FloppyDisk, HardDrive, Memory] = require('../src/st
66
describe('composity tests', () => {
77

88
it('sanity test', () => {
9-
var cabbinet = new EquipmentComposition("cabbinet");
10-
cabbinet.add(new FloppyDisk());
11-
cabbinet.add(new HardDrive());
12-
cabbinet.add(new Memory());
9+
var cabinet = new EquipmentComposition("cabinet");
10+
cabinet.add(new FloppyDisk());
11+
cabinet.add(new HardDrive());
12+
cabinet.add(new Memory());
1313

14-
expect(cabbinet.getPrice()).to.equal(600);
14+
expect(cabinet.getPrice()).to.equal(600);
1515
});
1616
});

test/composite_es6-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
const expect = require('chai').expect;
22

3-
import { Cabbinet, FloppyDisk, HardDrive, Memory } from '../src/structural/composite/composite_es6';
3+
import { Cabinet, FloppyDisk, HardDrive, Memory } from '../src/structural/composite/composite_es6';
44

55

66
describe('composity tests', () => {
77

88
it('sanity test', () => {
9-
const cabbinet = new Cabbinet();
10-
cabbinet.add(new FloppyDisk());
11-
cabbinet.add(new HardDrive());
12-
cabbinet.add(new Memory());
9+
const cabinet = new Cabinet();
10+
cabinet.add(new FloppyDisk());
11+
cabinet.add(new HardDrive());
12+
cabinet.add(new Memory());
1313

14-
expect(cabbinet.getPrice()).to.equal(600);
14+
expect(cabinet.getPrice()).to.equal(600);
1515
});
1616
});

0 commit comments

Comments
 (0)
0