Skip to content

Commit

Permalink
setup Other class.
Browse files Browse the repository at this point in the history
Some tests need to setup Other class with OtherSetup proc.
  • Loading branch information
ko1 committed Feb 28, 2020
1 parent 28399e4 commit 6787ccf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/ruby/test_module.rb
Expand Up @@ -302,6 +302,8 @@ def n.count; @count; end
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) {
Expand All @@ -310,6 +312,8 @@ def test_nested_get
end

def test_nested_get_symbol
OtherSetup.call

const = [self.class, Other].join('::').to_sym
assert_raise(NameError) {Object.const_get(const)}

Expand Down Expand Up @@ -345,6 +349,8 @@ def test_nested_defined
end

def test_nested_defined_symbol
OtherSetup.call

const = [self.class, Other].join('::').to_sym
assert_raise(NameError) {Object.const_defined?(const)}

Expand Down

0 comments on commit 6787ccf

Please sign in to comment.