Sha256: 9c33b8fd59d1318bfd1e852e934dbdcd353324df53b202c9341966c7c721d0c0
Contents?: true
Size: 398 Bytes
Versions: 12
Compression:
Stored size: 398 Bytes
Contents
class Array def extract_options! if last.is_a?(Hash) pop else {} end end end module Array::Etest 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 end if VEX_TEST == "boot"
Version data entries
12 entries across 12 versions & 1 rubygems