diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-03 16:34:21 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-03 16:34:21 +0900 |
| commit | 427ea605e7408fd2ed3b5c97d701c660b8028788 (patch) | |
| tree | 1914f4d72a56d6ba8969879d3bfcadb1bbb71907 /mrbgems/mruby-array-ext/test/array.rb | |
| parent | b81f0d0ffb7db46507f7b79ccb72cc94428555ce (diff) | |
| parent | 037a1d70880ecdcfd2d55eb10c234de1001eb654 (diff) | |
| download | mruby-427ea605e7408fd2ed3b5c97d701c660b8028788.tar.gz mruby-427ea605e7408fd2ed3b5c97d701c660b8028788.zip | |
Merge branch 'master' of github.com:mruby/mruby
Diffstat (limited to 'mrbgems/mruby-array-ext/test/array.rb')
| -rw-r--r-- | mrbgems/mruby-array-ext/test/array.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb index cb5652dde..8c919f7e0 100644 --- a/mrbgems/mruby-array-ext/test/array.rb +++ b/mrbgems/mruby-array-ext/test/array.rb @@ -285,3 +285,11 @@ assert('Array#values_at') do assert_equal ['none', nil, nil, 'red', 'green', 'purple'], a.values_at(4..6, 0...3) assert_raise(TypeError) { a.values_at 'tt' } end + +assert('Array#to_h') do + assert_equal({}, [].to_h) + assert_equal({a: 1, b:2}, [[:a, 1], [:b, 2]].to_h) + + assert_raise(TypeError) { [1].to_h } + assert_raise(ArgumentError) { [[1]].to_h } +end |
