Sha256: 5a60927f096d65cebabad8ba72e494da7c9cf61ae868a892bfafd44a9fa8a1a3

Contents?: true

Size: 1.15 KB

Versions: 17

Compression:

Stored size: 1.15 KB

Contents

require 'minitest/autorun'
require 'minitest/pride'
require_relative 'words'

class WordsTest < MiniTest::Unit::TestCase

  def test_count_one_word
    words = Words.new("word")
    counts = {"word" => 1}
    assert_equal counts, words.count
  end

  def test_count_one_of_each
    skip
    words = Words.new("one of each")
    counts = {"one" => 1, "of" => 1, "each" => 1}
    assert_equal counts, words.count
  end

  def test_count_multiple_occurrences
    skip
    words = Words.new("one fish two fish red fish blue fish")
    counts = {"one"=>1, "fish"=>4, "two"=>1, "red"=>1, "blue"=>1}
    assert_equal counts, words.count
  end

  def test_ignore_punctuation
    skip
    words = Words.new("car : carpet as java : javascript!!&@$%^&")
    counts = {"car"=>1, "carpet"=>1, "as"=>1, "java"=>1, "javascript"=>1}
    assert_equal counts, words.count
  end

  def test_include_numbers
    skip
    words = Words.new("testing, 1, 2 testing")
    counts = {"testing" => 2, "1" => 1, "2" => 1}
    assert_equal counts, words.count
  end

  def test_normalize_case
    skip
    words = Words.new("go Go GO")
    counts = {"go" => 3}
    assert_equal counts, words.count
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
exercism-0.0.28 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.27 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.26 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.25 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.24 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.23 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.22 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.21 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.20 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.19 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.18 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.17 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.16 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.15 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.14 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.13 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt
exercism-0.0.12 test/fixtures/approvals/alice_gets_word_count_tests.approved.txt