PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/enumerable/test_probability.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 11 lines | 8 code | 3 blank | 0 comment | 0 complexity | 52ccfbae98e0e9b67d0b4af0a61b1c16 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/enumerable/probability.rb'
  2. require 'test/unit'
  3. class Test_Enumerable_Probability < Test::Unit::TestCase
  4. def test_probability
  5. assert_equal( {'a'=>0.5,'b'=>0.5}, %w{a b}.probability )
  6. assert_equal( {'tom'=>0.5,'boy'=>0.5}, %w{tom boy}.probability )
  7. end
  8. end