/vendor/gems/facets-2.4.5/test/core/integer/test_of.rb
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
- require 'facets/integer/of'
- require 'test/unit'
- class TC_Integer_Of < Test::Unit::TestCase
- def test_of
- a = 4
- b = a.of{ |i| i*2 }
- assert_equal( [0,2,4,6], b )
- end
- def test_times_collect
- a = 4
- b = a.times_collect{ |i| i*2 }
- assert_equal( [0,2,4,6], b )
- end
- end