Skip to content

Instantly share code, notes, and snippets.

@joevandyk
Created April 12, 2011 19:57
Show Gist options
  • Save joevandyk/916256 to your computer and use it in GitHub Desktop.
Save joevandyk/916256 to your computer and use it in GitHub Desktop.
require 'test/unit'
module M
def f
CONSTANT + 1
end
end
class C
CONSTANT = 1
include M
end
class D
CONSTANT = 2
include M
end
class TestIt < Test::Unit::TestCase
def test_c
assert_equal 2, C.new.f
end
def test_d
assert_equal 3, D.new.f
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment