summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 6b9ac4416b..5450c8ff3a 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1475,6 +1475,20 @@ class TestModule < Test::Unit::TestCase
end
end
+ def test_prepend_optmethod
+ bug7983 = '[ruby-dev:47124] [Bug #7983]'
+ assert_separately [], %{
+ module M
+ def /(other)
+ to_f / other
+ end
+ end
+ Fixnum.send(:prepend, M)
+ assert_equal(0.5, 1 / 2, "#{bug7983}")
+ }
+ assert_equal(0, 1 / 2)
+ end
+
def test_class_variables
m = Module.new
m.class_variable_set(:@@foo, 1)