'use strict';

describe("WordCount", function() {
  var words;

  beforeEach(function() {
    words = new WordCount("This is a string; great, this, stuff");
  });

  describe("#split", function() {
    it("separates a string into an array of lowercase words", function() {
      expect(words.split()).toEqual(["this", "is", "a", "string", "great", "this", "stuff"]);
    });
  });

  describe("#createDictionary", function() {
    it("creates dictionary with words and their counts", function() {
      words.split();
      words.createDictionary();
      expect(words.dict).toEqual({"this": 2, "is": 1, "a": 1, "string": 1, "great": 1, "stuff": 1});
    });

    it("ignores numbers, only documents words", function() {
      var numbersAndWords = new WordCount("This is. quite. the 67 the inconvenient 89 String");
      numbersAndWords.split();
      numbersAndWords.createDictionary();
      expect(numbersAndWords.dict).toEqual({"this": 1, "is": 1, "quite": 1, "the": 2, "inconvenient": 1, "string": 1})
    });
  });

})

@@ -1001,27 +1001,290 @@
 ng%22: 1%7D)%0A    %7D);
+%0A%0A    it(%22creates an array with all words%22, function() %7B%0A      var manyWords = new WordCount(%22the The the the is is is a a tree%22);%0A      manyWords.split();%0A      manyWords.createDictionary();%0A      expect(manyWords.keys).toEqual(%22the%22, %22is%22, %22a%22, %22tree%22);%0A    %7D);
 %0A  %7D);%0A%0A%7D)%0A

Add failing test for keys array