From a24f068a2cc2ec4e078863d1920481bb79708fd2 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 13 Feb 2014 22:35:49 -0300 Subject: [PATCH] array-ext: add test to uniq_by method --- test/unit/array_core_ext_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+), 0 deletions(-) create mode 100644 test/unit/array_core_ext_test.rb diff --git a/test/unit/array_core_ext_test.rb b/test/unit/array_core_ext_test.rb new file mode 100644 index 0000000..035dea6 --- /dev/null +++ b/test/unit/array_core_ext_test.rb @@ -0,0 +1,11 @@ +require File.dirname(__FILE__) + '/../test_helper' + +# tests for Array core extension. See lib/noosfero/core_ext/array.rb +class StringCoreExtTest < ActiveSupport::TestCase + + should 'allow uniq by a block' do + array = [0,1,2,3,4,5,6] + assert_equal [0,1], array.uniq_by {|number| number%2 } + end + +end -- libgit2 0.21.2