mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02: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
|
end
|
||||||
|
|
||||||
def test_nested_get
|
def test_nested_get
|
||||||
|
OtherSetup.call
|
||||||
|
|
||||||
assert_equal Other, Object.const_get([self.class, 'Other'].join('::'))
|
assert_equal Other, Object.const_get([self.class, 'Other'].join('::'))
|
||||||
assert_equal User::USER, self.class.const_get([User, 'USER'].join('::'))
|
assert_equal User::USER, self.class.const_get([User, 'USER'].join('::'))
|
||||||
assert_raise(NameError) {
|
assert_raise(NameError) {
|
||||||
|
@ -310,6 +312,8 @@ class TestModule < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_nested_get_symbol
|
def test_nested_get_symbol
|
||||||
|
OtherSetup.call
|
||||||
|
|
||||||
const = [self.class, Other].join('::').to_sym
|
const = [self.class, Other].join('::').to_sym
|
||||||
assert_raise(NameError) {Object.const_get(const)}
|
assert_raise(NameError) {Object.const_get(const)}
|
||||||
|
|
||||||
|
@ -345,6 +349,8 @@ class TestModule < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_nested_defined_symbol
|
def test_nested_defined_symbol
|
||||||
|
OtherSetup.call
|
||||||
|
|
||||||
const = [self.class, Other].join('::').to_sym
|
const = [self.class, Other].join('::').to_sym
|
||||||
assert_raise(NameError) {Object.const_defined?(const)}
|
assert_raise(NameError) {Object.const_defined?(const)}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue