Created
January 8, 2009 10:54
-
-
Save MrJaba/44684 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
class A | |
self << class | |
private | |
def private_method_test | |
end | |
end | |
end | |
--------- | |
class B | |
private | |
def self.private_method_test | |
end | |
end | |
------ | |
require 'mocha' | |
class TestClassA | |
A.expects(:private_method_test).returns(nil) | |
B.expects(:private_method_test).returns(nil) | |
end | |
class TestClassB | |
A.send(:private_method_test) #Throws method not found exception | |
B.send(:private_method_test) #Works fine? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment