Sha256: 9aa4cb45aaf47bdd03aab1a04d44d0a9f1cad8301c489bfc532f946e6e812383
Contents?: true
Size: 872 Bytes
Versions: 9
Compression:
Stored size: 872 Bytes
Contents
# encoding: utf-8 require 'helper' class ArrayExtTest < Test::Unit::TestCase def test_extract_options array = [ 1, 2, 3 ] options = array.extract_options! assert_equal({}, options) assert_equal([1,2,3], array) array = [ ] options = array.extract_options! assert_equal({}, options) assert_equal([], array) array = [ 1, 2, 3, {} ] options = array.extract_options! assert_equal({}, options) assert_equal([1,2,3], array) array = [ {} ] options = array.extract_options! assert_equal({}, options) assert_equal([], array) array = [ 1, 2, 3, { 1 => 2 } ] options = array.extract_options! assert_equal({ 1 => 2 }, options) assert_equal([1,2,3], array) array = [ { 1 => 2 } ] options = array.extract_options! assert_equal({ 1 => 2 }, options) assert_equal([], array) end end
Version data entries
9 entries across 9 versions & 2 rubygems