diff options
author | Jeremy Evans <code@jeremyevans.net> | 2021-03-05 12:47:00 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2021-03-06 13:56:16 -0800 |
commit | 68d028578a5975fe6c44d29c502615ff9af72927 (patch) | |
tree | 151a19b8ddbf97460301a4b970e8897f689e252a /test | |
parent | e1d16a9e560a615e122e457325bcfb7c47228ed6 (diff) |
Undef Enumerator::Chain#{feed,next,next_values,peek,peek_values}
Previously these methods were defined but raised TypeError, which
seems worse.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3811
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enumerator.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_enumerator.rb b/test/ruby/test_enumerator.rb index 4e698fc478..4342c10d02 100644 --- a/test/ruby/test_enumerator.rb +++ b/test/ruby/test_enumerator.rb @@ -832,6 +832,12 @@ class TestEnumerator < Test::Unit::TestCase assert_equal(33, chain.next) end + def test_chain_undef_methods + chain = [1].to_enum + [2].to_enum + meths = (chain.methods & [:feed, :next, :next_values, :peek, :peek_values]) + assert_equal(0, meths.size) + end + def test_produce assert_raise(ArgumentError) { Enumerator.produce } |