weird behavior of mocking ruby class methods