I have to mock a method which is not associated with any class. Could someone help me?
It's something like this:
status = connect(target)
puts "connecting to target device"
I have to mock a method which is not associated with any class.
There is no such thing as a method not associated with any module. There is exactly one kind of method in Ruby: instance methods of modules (or classes, which are modules).
connect is defined as a
private instance method of
You would mock it something like this:
Note that it doesn't even matter anyway, where the method is defined: there is no mention of either