I have a class method that I would like to make fun of and return one of the arguments that were passed. Something like this in my code:
converted_data = Myclass.convert(arg, some_other_arg, data)
And in my test, I would like to be able to do the following (although this does not work).
Myclass.should_receive(:convert).with(*args).and_return(args[2])
Thus, the method actually does nothing! If I run, as described above, I get an error message that it does not know which arguments should return.
Simmo source share