Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Created March 19, 2011 05:41
Show Gist options
  • Save Watson1978/877254 to your computer and use it in GitHub Desktop.
Save Watson1978/877254 to your computer and use it in GitHub Desktop.
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
module ConstantSpecs
class ParentA
CS_CONST20 = :const20_2
end
class ContainerA
class ChildA < ParentA
def self.const20; CS_CONST20; end
end
end
end
assert_equal(:const20_2, ConstantSpecs::ContainerA::ChildA.const20)
class ::Object
CS_CONST20 = :const20_1
module ConstantSpecs
class ContainerA
class ChildA
def self.const20; CS_CONST20; end
end
end
end
end
assert_equal(:const20_1, ConstantSpecs::ContainerA::ChildA.const20)
puts :ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment