Class: TestHash

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/test/unit/hash_test.rb

Instance Method Summary collapse

Instance Method Details

#test_to_hashObject



4
5
6
7
8
9
# File 'lib/test/unit/hash_test.rb', line 4

def test_to_hash
  categories_hash = { "pos" => { doc_count: 0, prior: 0.0, tokens: {}, token_count: 0 } }
  categories = OmniCat::Hash.new
  categories["pos"] = OmniCat::Classifiers::BayesInternals::Category.new(categories_hash["pos"])
  assert_equal(categories_hash, categories.to_hash)
end