summaryrefslogtreecommitdiff
path: root/test/ruby/test_refinement.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_refinement.rb')
-rw-r--r--test/ruby/test_refinement.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index f6e0872..82bdb49 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1886,6 +1886,20 @@ class TestRefinement < Test::Unit::TestCase
assert_equal("Parent -> Child", SuperToModule::Child.test, bug)
end
+ def test_include_refinement
+ bug = '[ruby-core:79632] [Bug #13236] cannot include refinement module'
+ r = nil
+ m = Module.new do
+ r = refine(String) {def test;:ok end}
+ end
+ assert_raise_with_message(ArgumentError, /refinement/, bug) do
+ m.module_eval {include r}
+ end
+ assert_raise_with_message(ArgumentError, /refinement/, bug) do
+ m.module_eval {prepend r}
+ end
+ end
+
private
def eval_using(mod, s)