Sha256: dd6b196a76bee8da3188ac739e220001026fef54226ed3b4c7f96711ae339d3d

Contents?: true

Size: 1.87 KB

Versions: 9

Compression:

Stored size: 1.87 KB

Contents

var BeerSong = require('./beer-song');

describe('BeerSong', function() {
  var song = new BeerSong();

  it('prints an arbitrary verse', function() {
    var expected = '8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n';
    expect(song.verse(8)).toEqual(expected);
  });

  xit('handles 1 bottle', function() {
    var expected = '1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n';
    expect(song.verse(1)).toEqual(expected);
  });

  xit('handles 0 bottles', function() {
    var expected = 'No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n';
    expect(song.verse(0)).toEqual(expected);
  });

  xit('sings several verses', function() {
    var expected = '8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n';
    expect(song.sing(8, 6)).toEqual(expected);
  });

  xit('sings the rest of the verses', function() {
    var expected = '3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n';
    expect(song.sing(3)).toEqual(expected);
  });
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
trackler-1.0.4.0 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.3.0 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.2.1 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.2.0 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.1.2 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.1.1 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.1.0 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.0.1 tracks/javascript/exercises/beer-song/beer-song.spec.js
trackler-1.0.0 tracks/javascript/exercises/beer-song/beer-song.spec.js