Sha256: 59d30e5e84fc233b84a7ef7e6cd8c01e6f03435c00f5b729e0c992230d5d9f4b

Contents?: true

Size: 1.61 KB

Versions: 114

Compression:

Stored size: 1.61 KB

Contents

var TwoBucket = require('./two-bucket');

describe('TwoBucket', function () {
  describe('Measure using bucket one of size 3 and bucket two of size 5', function () {
    var bucketOne = 3;
    var bucketTwo = 5;
    var goal = 1;

    it('start with bucket one', function () {
      var twoBucket = new TwoBucket(bucketOne, bucketTwo, goal, 'one');

      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
    });

    xit('start with bucket two', function () {
      var twoBucket = new TwoBucket(bucketOne, bucketTwo, goal, 'two');

      expect(twoBucket.moves()).toEqual(8);
      expect(twoBucket.goalBucket).toEqual('two');
      expect(twoBucket.otherBucket).toEqual(3);
    });
  });

  describe('Measure using bucket one of size 7 and bucket two of size 11', function () {
    var bucketOne = 7;
    var bucketTwo = 11;
    var goal = 2;

    xit('start with bucket one', function () {
      var twoBucket = new TwoBucket(bucketOne, bucketTwo, goal, 'one');

      expect(twoBucket.moves()).toEqual(14);
      expect(twoBucket.goalBucket).toEqual('one');
      expect(twoBucket.otherBucket).toEqual(11);
    });

    xit('start with bucket two', function () {
      var twoBucket = new TwoBucket(bucketOne, bucketTwo, goal, 'two');

      expect(twoBucket.moves()).toEqual(18);
      expect(twoBucket.goalBucket).toEqual('two');
      expect(twoBucket.otherBucket).toEqual(7);
    });
  });
});

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.138 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.137 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.136 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.135 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.134 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.133 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.132 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.131 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.130 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.129 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.128 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.127 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.126 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.125 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.124 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.123 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.122 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.121 tracks/javascript/exercises/two-bucket/two-bucket.spec.js
trackler-2.2.1.120 tracks/javascript/exercises/two-bucket/two-bucket.spec.js