summaryrefslogtreecommitdiff
path: root/test/ruby/test_enum.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_enum.rb')
-rw-r--r--test/ruby/test_enum.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 237bdc8a4d..32ec4f5779 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -69,11 +69,11 @@ class TestEnumerable < Test::Unit::TestCase
assert_equal(['z', 42, nil], [:a, 'b', 'z', :c, 42, nil].grep_v(/[a-d]/), bug17030)
assert_equal('match', $1, bug17030)
- regexp = Regexp.new('x')
- assert_equal([], @obj.grep(regexp), bug17030) # sanity check
- def regexp.===(other)
- true
- end
+ regexp = Class.new(Regexp) {
+ def ===(other)
+ true
+ end
+ }.new('x')
assert_equal([1, 2, 3, 1, 2], @obj.grep(regexp), bug17030)
o = Object.new