module A
module B
class C
def fun(github)
return username
end
def gun(github)
author=fun(github)
#perfom some operation
return count
end
end
end
I want to test gun function, but to get the value of author, it is making a call to function fun. Now, I do not want to call this function and instead stub it.
To achieve that, I wrote this line in the before do section while testing the function_1, But it's not working.
allow(A::B::C).to receive(:fun).and_return("username")
I cannot figure out.