Created
September 15, 2010 20:16
-
-
Save rubyist/581387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'test/unit' | |
| module Stuff | |
| def self.included(base) | |
| base.extend Stuff::ClassMethods | |
| end | |
| module ClassMethods | |
| def foo | |
| 'foo' | |
| end | |
| end | |
| def bar | |
| 'bar' | |
| end | |
| end | |
| class A | |
| include Stuff | |
| end | |
| class ATest < Test::Unit::TestCase | |
| def test_a_has_bar | |
| assert_equal 'bar', A.new.bar | |
| end | |
| def test_A_has_foo | |
| assert_equal 'foo', A.foo | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment