Skip to content

Instantly share code, notes, and snippets.

@mkaschenko
Created September 10, 2010 17:46
Show Gist options
  • Save mkaschenko/574060 to your computer and use it in GitHub Desktop.
Save mkaschenko/574060 to your computer and use it in GitHub Desktop.
C = "top level"
class AboutConstants < EdgeCase::Koan
C = "nested"
def test_nested_constants_may_also_be_referenced_with_relative_paths
assert_equal "nested", C
end
def test_top_level_constants_are_referenced_by_double_colons
assert_equal "top level", ::C
end
def test_nested_constants_are_referenced_by_their_complete_path
assert_equal "nested", AboutConstants::C
assert_equal "nested", ::AboutConstants::C
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment