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:
parent
28399e4e0f
commit
6787ccf238
1 changed files with 6 additions and 0 deletions
|
@ -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)}
|
||||
|
||||
|
|
Loading…
Reference in a new issue