Sha256: d02ad4075fb917edf81890d17f1c53e822e206dc1adb6f5fbf8ec81c9587b5d4
Contents?: true
Size: 1.7 KB
Versions: 185
Compression:
Stored size: 1.7 KB
Contents
import TwoBucket from './two-bucket'; describe('TwoBucket', () => { describe('works for input of 3, 5, 1', () => { const buckOne = 3; const buckTwo = 5; const goal = 1; test('starting with bucket one', () => { const starterBuck = 'one'; // indicates which bucket to fill first const twoBucket = new TwoBucket(buckOne, buckTwo, goal, starterBuck); expect(twoBucket.moves()).toEqual(4); // includes the first fill expect(twoBucket.goalBucket).toEqual('one'); // which bucket should end up with the desired # of liters expect(twoBucket.otherBucket).toEqual(5); // leftover value in the "other" bucket once the goal has been reached }); xtest('starting with bucket two', () => { const starterBuck = 'two'; const twoBucket = new TwoBucket(buckOne, buckTwo, goal, starterBuck); expect(twoBucket.moves()).toEqual(8); expect(twoBucket.goalBucket).toEqual('two'); expect(twoBucket.otherBucket).toEqual(3); }); }); describe('works for input of 7, 11, 2', () => { const buckOne = 7; const buckTwo = 11; const goal = 2; xtest('starting with bucket one', () => { const starterBuck = 'one'; const twoBucket = new TwoBucket(buckOne, buckTwo, goal, starterBuck); expect(twoBucket.moves()).toEqual(14); expect(twoBucket.goalBucket).toEqual('one'); expect(twoBucket.otherBucket).toEqual(11); }); xtest('starting with bucket two', () => { const starterBuck = 'two'; const twoBucket = new TwoBucket(buckOne, buckTwo, goal, starterBuck); expect(twoBucket.moves()).toEqual(18); expect(twoBucket.goalBucket).toEqual('two'); expect(twoBucket.otherBucket).toEqual(7); }); }); });
Version data entries
185 entries across 185 versions & 1 rubygems