Module: Array::Etest

Defined in:
lib/vex/boot/array.rb

Instance Method Summary collapse

Instance Method Details

#test_extract_optionsObject


12
13
14
15
16
17
18
19
20
# File 'lib/vex/boot/array.rb', line 12

def test_extract_options
  arr = %w(1 2)
  assert_equal({}, arr.extract_options!)
  assert_equal(%w(1 2), arr)

  arr = [ 1, 2, { :a => :b }]
  assert_equal({ :a => :b }, arr.extract_options!)
  assert_equal( [ 1,  2 ], arr)
end