Created
December 22, 2011 17:30
-
-
Save floehopper/1511111 to your computer and use it in GitHub Desktop.
This file contains 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" | |
require "rubygems" | |
require "mocha" | |
class Foo | |
def self.foo | |
"foo" | |
end | |
end | |
class FooChildOne < Foo | |
def self.foo | |
"foo-child-one" | |
end | |
end | |
class FooChildTwo < Foo | |
def self.foo | |
"foo-child-two" | |
end | |
end | |
class FooTest < Test::Unit::TestCase | |
def test_foo | |
FooChildOne.expects(:foo) | |
FooChildTwo.expects(:foo) | |
FooChildOne.foo | |
FooChildTwo.foo | |
end | |
end | |
# this behaves as I would expect i.e. the test passes unless I remove one or more of the calls to `FooChildOne.foo` or `FooChildTwo.foo` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment