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

/vendor/gems/facets-2.4.5/test/core/integer/test_of.rb

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 19 lines | 14 code | 5 blank | 0 comment | 0 complexity | 215b71c57998a0ecfbd69a524d94e9e5 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/integer/of'
  2. require 'test/unit'
  3. class TC_Integer_Of < Test::Unit::TestCase
  4. def test_of
  5. a = 4
  6. b = a.of{ |i| i*2 }
  7. assert_equal( [0,2,4,6], b )
  8. end
  9. def test_times_collect
  10. a = 4
  11. b = a.times_collect{ |i| i*2 }
  12. assert_equal( [0,2,4,6], b )
  13. end
  14. end