1 # frozen_string_literal: false
2 require '-test-/notimplement'
4 class Test_NotImplement < Test::Unit::TestCase
5 def test_funcall_notimplement
6 bug3662 = '[ruby-dev:41953]'
7 assert_raise(NotImplementedError, bug3662) {
8 Bug.funcall(:notimplement)
10 assert_raise(NotImplementedError) {
11 Bug::NotImplement.new.notimplement
16 assert_include(Bug.methods(false), :notimplement)
17 assert_include(Bug::NotImplement.instance_methods(false), :notimplement)
18 assert_not_respond_to(Bug, :notimplement)
19 assert_not_respond_to(Bug::NotImplement.new, :notimplement)
22 def test_method_inspect_notimplement
23 assert_match(/not-implemented/, Bug.method(:notimplement).inspect)
24 assert_match(/not-implemented/, Bug::NotImplement.instance_method(:notimplement).inspect)
27 def test_not_method_defined
28 assert !Bug::NotImplement.method_defined?(:notimplement)
29 assert !Bug::NotImplement.method_defined?(:notimplement, true)
30 assert !Bug::NotImplement.method_defined?(:notimplement, false)
33 def test_not_private_method_defined
34 assert !Bug::NotImplement.private_method_defined?(:notimplement)
35 assert !Bug::NotImplement.private_method_defined?(:notimplement, true)
36 assert !Bug::NotImplement.private_method_defined?(:notimplement, false)
39 def test_not_protected_method_defined
40 assert !Bug::NotImplement.protected_method_defined?(:notimplement)
41 assert !Bug::NotImplement.protected_method_defined?(:notimplement, true)
42 assert !Bug::NotImplement.protected_method_defined?(:notimplement, false)