Skip to content

Instantly share code, notes, and snippets.

@MrJaba
Created January 8, 2009 10:54
Show Gist options
  • Save MrJaba/44684 to your computer and use it in GitHub Desktop.
Save MrJaba/44684 to your computer and use it in GitHub Desktop.
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