I have a helper module named "AppHelper" and private method "sum" which I want to test using rspec.
For example:
module AppHelper
private
def sum(a,b)
puts a+b
end
end
ideally private methods can not test directly, it should be called from public method but here is a hack
create a dummy class and access private method using .send(:private_method, args)
example
obj = Class.new { extend AppHelper } obj.send(:sum, 1,2)