Code.load_file("word-count.exs")
ExUnit.start

defmodule WordsTest do
  use ExUnit.Case

  test "count one word" do
    assert Words.count("word") == HashDict.new [{ "word", 1 }]
  end

  test "count one of each" do
    expected = HashDict.new [{ "one", 1 }, { "of", 1 }, { "each", 1 }]
    assert Words.count("one of each") == expected
  end

  test "count multiple occurrences" do
    expected = HashDict.new [{ "one", 1 }, { "fish", 4 }, { "two", 1 }, { "red", 1 }, { "blue", 1 }]
    assert Words.count("one fish two fish red fish blue fish") == expected
  end

  test "ignore punctuation" do
    expected = HashDict.new [{"car", 1}, {"carpet", 1}, {"as", 1}, {"java", 1}, {"javascript", 1}]
    assert Words.count("car : carpet as java : javascript!!&@$%^&") == expected
  end

  test "include numbers" do
    expected = HashDict.new [{"testing", 2}, {"1", 1}, {"2", 1}]
    assert Words.count("testing, 1, 2 testing") == expected
  end

  test "normalize case" do
    expected = HashDict.new [{"go", 3}]
    assert Words.count("go Go GO") == expected
  end
end

Code.load_file("word_count.exs")
ExUnit.start

defmodule WordsTest do
  use ExUnit.Case

  test "count one word" do
    assert Words.count("word") == HashDict.new [{ "word", 1 }]
  end

  test "count one of each" do
    expected = HashDict.new [{ "one", 1 }, { "of", 1 }, { "each", 1 }]
    assert Words.count("one of each") == expected
  end

  test "count multiple occurrences" do
    expected = HashDict.new [{ "one", 1 }, { "fish", 4 }, { "two", 1 }, { "red", 1 }, { "blue", 1 }]
    assert Words.count("one fish two fish red fish blue fish") == expected
  end

  test "ignore punctuation" do
    expected = HashDict.new [{"car", 1}, {"carpet", 1}, {"as", 1}, {"java", 1}, {"javascript", 1}]
    assert Words.count("car : carpet as java : javascript!!&@$%^&") == expected
  end

  test "include numbers" do
    expected = HashDict.new [{"testing", 2}, {"1", 1}, {"2", 1}]
    assert Words.count("testing, 1, 2 testing") == expected
  end

  test "normalize case" do
    expected = HashDict.new [{"go", 3}]
    assert Words.count("go Go GO") == expected
  end
end

Use underscore to require file in elixir/word-count
Use underscore to require file in elixir/word-count

IanDCarroll/exercism.io,nathanbwright/exercism.io,beni55/exercism.io,hanumakanthvvn/exercism.io,mhelmetag/exercism.io,Tonkpils/exercism.io,RaptorRCX/exercism.io,exercistas/exercism.io,k4rtik/exercism.io,bmulvihill/exercism.io,emilyforst/exercism.io,Tonkpils/exercism.io,mscoutermarsh/exercism_coveralls,treiff/exercism.io,amar47shah/exercism.io,colinrubbert/exercism.io,beni55/exercism.io,bmulvihill/exercism.io,jtigger/exercism.io,jtigger/exercism.io,tejasbubane/exercism.io,copiousfreetime/exercism.io,mscoutermarsh/exercism_coveralls,treiff/exercism.io,nathanbwright/exercism.io,alexclarkofficial/exercism.io,nathanbwright/exercism.io,k4rtik/exercism.io,praveenpuglia/exercism.io,bmulvihill/exercism.io,mhelmetag/exercism.io,mscoutermarsh/exercism_coveralls,chastell/exercism.io,copiousfreetime/exercism.io,chinaowl/exercism.io,beni55/exercism.io,sheekap/exercism.io,mscoutermarsh/exercism_coveralls,tejasbubane/exercism.io,Tonkpils/exercism.io,mscoutermarsh/exercism_coveralls,mhelmetag/exercism.io,mscoutermarsh/exercism_coveralls,mscoutermarsh/exercism_coveralls,MBGeoff/Exercism.io-mbgeoff,RaptorRCX/exercism.io,kangkyu/exercism.io,k4rtik/exercism.io,Tonkpils/exercism.io,sheekap/exercism.io,kizerxl/exercism.io,sheekap/exercism.io,emilyforst/exercism.io,colinrubbert/exercism.io,chinaowl/exercism.io,IanDCarroll/exercism.io,praveenpuglia/exercism.io,mscoutermarsh/exercism_coveralls,emilyforst/exercism.io,kangkyu/exercism.io,exercistas/exercism.io,IanDCarroll/exercism.io,amar47shah/exercism.io,praveenpuglia/exercism.io,kizerxl/exercism.io,MBGeoff/Exercism.io-mbgeoff,treiff/exercism.io,chinaowl/exercism.io,RaptorRCX/exercism.io,copiousfreetime/exercism.io,alexclarkofficial/exercism.io,bmulvihill/exercism.io,exercistas/exercism.io,chastell/exercism.io,sheekap/exercism.io,IanDCarroll/exercism.io,mscoutermarsh/exercism_coveralls,chastell/exercism.io,hanumakanthvvn/exercism.io,kizerxl/exercism.io,jtigger/exercism.io,nathanbwright/exercism.io,MBGeoff/Exercism.io-mbgeoff,hanumakanthvvn/exercism.io,hanumakanthvvn/exercism.io,jtigger/exercism.io,tejasbubane/exercism.io,colinrubbert/exercism.io,tejasbubane/exercism.io,kangkyu/exercism.io,amar47shah/exercism.io,alexclarkofficial/exercism.io,mscoutermarsh/exercism_coveralls,copiousfreetime/exercism.io,treiff/exercism.io,RaptorRCX/exercism.io,praveenpuglia/exercism.io,mhelmetag/exercism.io