2015-12-16 05:07:31 +00:00
|
|
|
# frozen_string_literal: false
|
2015-05-17 14:47:36 +00:00
|
|
|
require '-test-/notimplement'
|
2010-08-07 04:33:33 +00:00
|
|
|
|
2018-03-13 06:29:02 +00:00
|
|
|
class Test_NotImplement < Test::Unit::TestCase
|
2010-08-07 04:33:33 +00:00
|
|
|
def test_funcall_notimplement
|
|
|
|
bug3662 = '[ruby-dev:41953]'
|
|
|
|
assert_raise(NotImplementedError, bug3662) {
|
|
|
|
Bug.funcall(:notimplement)
|
|
|
|
}
|
2018-08-21 14:57:56 +00:00
|
|
|
assert_raise(NotImplementedError) {
|
|
|
|
Bug::NotImplement.new.notimplement
|
|
|
|
}
|
2010-08-07 04:33:33 +00:00
|
|
|
end
|
2015-05-18 06:31:42 +00:00
|
|
|
|
|
|
|
def test_respond_to
|
|
|
|
assert_not_respond_to(Bug, :notimplement)
|
2018-08-21 14:57:56 +00:00
|
|
|
assert_not_respond_to(Bug::NotImplement.new, :notimplement)
|
2015-05-18 06:31:42 +00:00
|
|
|
end
|
2018-08-13 13:27:49 +00:00
|
|
|
|
|
|
|
def test_not_method_defined
|
2018-08-13 13:50:48 +00:00
|
|
|
assert !Bug::NotImplement.method_defined?(:notimplement)
|
2018-08-13 14:29:21 +00:00
|
|
|
assert !Bug::NotImplement.method_defined?(:notimplement, true)
|
|
|
|
assert !Bug::NotImplement.method_defined?(:notimplement, false)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_not_private_method_defined
|
|
|
|
assert !Bug::NotImplement.private_method_defined?(:notimplement)
|
|
|
|
assert !Bug::NotImplement.private_method_defined?(:notimplement, true)
|
|
|
|
assert !Bug::NotImplement.private_method_defined?(:notimplement, false)
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_not_protected_method_defined
|
|
|
|
assert !Bug::NotImplement.protected_method_defined?(:notimplement)
|
|
|
|
assert !Bug::NotImplement.protected_method_defined?(:notimplement, true)
|
|
|
|
assert !Bug::NotImplement.protected_method_defined?(:notimplement, false)
|
2018-08-13 13:27:49 +00:00
|
|
|
end
|
2010-08-07 04:33:33 +00:00
|
|
|
end
|