UNB/ CS/ David Bremner/ teaching/ cs2613/ assignments/ A4/ moarlife.spec.js
var life=require ("./moarlife.js");

var plan= ["############################",
           "#####                 ######",
           "##   ***                **##",
           "#   *##**         **  O  *##",
           "#    ***     O    ##**    *#",
           "#       O         ##***    #",
           "#                 ##**     #",
           "#   O       #*             #",
           "#*          #**       O    #",
           "#***        ##**    O    **#",
           "##****     ###***       *###",
           "############################"];


describe("World",
         function () {
             var valley = new life.LifelikeWorld(plan,
                 {"#": life.Wall,
                  "O": life.PlantEater,
                  "*": life.Plant});
             it("roundtrip",
                function() {
                    var rows = valley.toString().split("\n");
                    // drop blank row
                    rows.pop();
                    expect(rows).toEqual(plan);
                });
         });