-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
10 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
exercises/practice/resistor-color-duo/resistor-color-duo.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class ResistorColorDuo | ||
value: (colors) -> | ||
@value: (colors) -> | ||
|
||
module.exports = ResistorColorDuo |
15 changes: 7 additions & 8 deletions
15
exercises/practice/resistor-color-duo/resistor-color-duo.spec.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
ResistorColorDuo = require './resistor-color-duo' | ||
|
||
describe 'ResistorColorDuo', -> | ||
rc = new ResistorColorDuo() | ||
it 'Brown and black', -> | ||
results = rc.value(['brown', 'black']) | ||
results = ResistorColorDuo.value(['brown', 'black']) | ||
expected = 10 | ||
expect(results).toEqual expected | ||
|
||
xit 'Blue and grey', -> | ||
results = rc.value(['blue', 'grey']) | ||
results = ResistorColorDuo.value(['blue', 'grey']) | ||
expected = 68 | ||
expect(results).toEqual expected | ||
|
||
xit 'Yellow and violet', -> | ||
results = rc.value(['yellow', 'violet']) | ||
results = ResistorColorDuo.value(['yellow', 'violet']) | ||
expected = 47 | ||
expect(results).toEqual expected | ||
|
||
xit 'White and red', -> | ||
results = rc.value(['white', 'red']) | ||
results = ResistorColorDuo.value(['white', 'red']) | ||
expected = 92 | ||
expect(results).toEqual expected | ||
|
||
xit 'Orange and orange', -> | ||
results = rc.value(['orange', 'orange']) | ||
results = ResistorColorDuo.value(['orange', 'orange']) | ||
expected = 33 | ||
expect(results).toEqual expected | ||
|
||
xit 'Ignore additional colors', -> | ||
results = rc.value(['green', 'brown', 'orange']) | ||
results = ResistorColorDuo.value(['green', 'brown', 'orange']) | ||
expected = 51 | ||
expect(results).toEqual expected | ||
|
||
xit 'Black and brown, one-digit', -> | ||
results = rc.value(['black', 'brown']) | ||
results = ResistorColorDuo.value(['black', 'brown']) | ||
expected = 1 | ||
expect(results).toEqual expected |