1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

setup Other class.

Some tests need to setup Other class with OtherSetup proc.
This commit is contained in:
Koichi Sasada 2020-02-28 17:57:45 +09:00
parent 28399e4e0f
commit 6787ccf238

View file

@ -302,6 +302,8 @@ class TestModule < Test::Unit::TestCase
end
def test_nested_get
OtherSetup.call
assert_equal Other, Object.const_get([self.class, 'Other'].join('::'))
assert_equal User::USER, self.class.const_get([User, 'USER'].join('::'))
assert_raise(NameError) {
@ -310,6 +312,8 @@ class TestModule < Test::Unit::TestCase
end
def test_nested_get_symbol
OtherSetup.call
const = [self.class, Other].join('::').to_sym
assert_raise(NameError) {Object.const_get(const)}
@ -345,6 +349,8 @@ class TestModule < Test::Unit::TestCase
end
def test_nested_defined_symbol
OtherSetup.call
const = [self.class, Other].join('::').to_sym
assert_raise(NameError) {Object.const_defined?(const)}