diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-12-28 15:19:13 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-28 15:19:13 +0900 |
| commit | 6d98ae57f226da08ab374fb6347ddced7dea8b0e (patch) | |
| tree | f6127be29df955c2cdfe0c06e5997bb77103fd0a /mrbgems/mruby-hash-ext/test/hash.rb | |
| parent | d57d6e2b5b67d39db8d1d80e699177cb35741661 (diff) | |
| parent | 14a92f97053ee51128fce335e05f88b536316155 (diff) | |
| download | mruby-6d98ae57f226da08ab374fb6347ddced7dea8b0e.tar.gz mruby-6d98ae57f226da08ab374fb6347ddced7dea8b0e.zip | |
Merge pull request #5248 from SeekingMeaning/hash-except
Add `Hash#except` [Ruby 3.0]
Diffstat (limited to 'mrbgems/mruby-hash-ext/test/hash.rb')
| -rw-r--r-- | mrbgems/mruby-hash-ext/test/hash.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mrbgems/mruby-hash-ext/test/hash.rb b/mrbgems/mruby-hash-ext/test/hash.rb index fdf4c57a8..78e8b3a3a 100644 --- a/mrbgems/mruby-hash-ext/test/hash.rb +++ b/mrbgems/mruby-hash-ext/test/hash.rb @@ -288,3 +288,10 @@ assert("Hash#slice") do assert_equal({:a=>100}, h.slice(:a)) assert_equal({:b=>200, :c=>300}, h.slice(:b, :c, :d)) end + +assert("Hash#except") do + h = { a: 100, b: 200, c: 300 } + assert_equal({:b=>200, :c=>300}, h.except(:a)) + assert_equal({:a=>100}, h.except(:b, :c, :d)) + assert_equal(h, h.except) +end |
